brLocateSeq Method Example

Sub Main()

Dim oEnv As New clsD3Environment

Dim oConn As clsD3Connection

Dim oArray As New clsD3DynamicArray

Dim oContinent As New clsD3DynamicArray

Dim oSeq As New clsD3DynamicArray

Dim lFound As Long

 

Set oConn = oEnv.brOpenConnection("ODBC", "production")

oArray.brCString = "Europe" & D3VMChr & "South America" & D3VMChr & "Africa" 

Set oArray = oConn.brSort(oArray)

 

oContinent.brCString = InputBox("Enter a continent")

oSeq.brCString = "al"

If oArray.brLocateSeq(oContinent, oSeq, lFound, 1) = True Then

MsgBox oContinent.brCString & " is already there."

Else

oArray.brInsertStr oContinent.brCString, 1, lFound

End If

 

MsgBox oArray.brCString

 

oEnv.brCloseConnection oConn

Set oArray = Nothing

Set oContinent = Nothing

Set oSeq = Nothing

Set oEnv = Nothing

End Sub