brSort method

Sorts in ascending order a clsD3DynamicArray object and returns another clsD3DynamicArray object.

Note: See the Remarks section for RPC and ODBC connection exceptions.

Syntax

Set oDynArraySorted = object.brSort( oDynArrayUnsorted)

Parameters

Parameter Description
oDynArraySorted An object variable that represents a clsD3DynamicArray object that is sorted.
object An object variable that represents a clsD3Connection object.
oDynArrayUnsorted An object variable that represents a clsD3DynamicArray object containing unsorted data.

Remarks

  • Using an RPC connection, the sort is implemented on both the client and server.

  • Using an ODBC connection, the sort is implemented on the server.

Example

Sub Main()
   Dim oEnv As New clsD3Environment
   Dim oConn As clsD3Connection
   Dim oArray As New clsD3DynamicArray
   Dim sContinent As String
   Dim lFound As Long
 
   Set oConn = oEnv.brOpenConnection("ODBC", "production")
   oArray.brCString = "Europe" & D3VMChr & "South America" & D3VMChr & "Africa"
   Set oArray = oConn.brSort(oArray)
 
   sContinent = InputBox("Enter a continent")
   If oArray.brLocateStrSeq(sContinent, "al", lFound, 1) = True Then
      MsgBox sContinent & " is already there."
   Else
      oArray.brInsertStr sContinent, 1, lFound
   End If
 
   MsgBox oArray.brCString
 
   oEnv.brCloseConnection oConn
   Set oArray = Nothing
   Set oEnv = Nothing
End Sub

FlashBASIC reference

sort