Finds the last entry in the index that partially matches the passed key.
bValue = object.brFindLast( sKey, [ vsIId])
Parameter | Description |
---|---|
bValue | The return value is a Boolean data type that is False only if no match to sKey is found in the index. |
object | An object variable that represents a clsD3Index object. |
sKey | A String containing the search string. |
vsIId | Optional. A Variant (String subtype) containing the item-id of the last D3 item whose index matches sKey. This is an output-only parameter that returns the same result as the brIndexId property. |
If no match to sKey is found in the index, then the return value is False. The item-id returned is that of the next sequential entry in the index, unless this is past the end of the index.
If sKey is null, then the last entry in the index is returned. This causes the system to search for the last key that partially matches a null string, causing traversal of the entire index.
Sub Search_Click() Dim oFile As clsD3File Dim oIndex As clsD3Index Dim sStart As String OpenConnection ' Subroutine to establish connection Set oFile = oConn.brOpenFile("customers") Set oIndex = oFile.brRoot("a1") ' Looking at customers with names beginning with F sStart = "F" ' Find the first and last customer with a name ' beginning with F - display results in a text box oIndex.brFindFirst (sStart) sSearchResults = "This search will result in customers: “ & oIndex.brIndexKey oIndex.brFindLast(sStart) ' Results will be displayed in text box RichTextBox1.Text = sSearchResults & " through " & oIndex.brIndexKey oConn.brCloseFile oFile CloseConnection ' Subroutine to close connection End Sub
key - with the 'l' operator