brMoveNext method

Moves to the next entry in the index.

Syntax

bValue = object.brMoveNext([ vsIId])

Parameters

Parameter Description
bValue The return value is a Boolean data type that is False only if the requested key is past the end of the index.
object An object variable that represents a clsD3Index object.
vsIId Optional. A Variant (String subtype) containing the item-id of the D3 item returned. This is an output-only parameter that returns the same result as the brIndexId property.

Remarks

If brMoveNext is the first index operation performed, then the first item returned is the top of the index, as shown in the example. To cruise an index from somewhere other than the beginning, use a brFind method, such as brFindFirst, then use brMoveNext to sequentially cruise through the index.

Example

Sub Main()
   Dim oEnv As New clsD3Environment
   Dim oConn As clsD3Connection
   Dim oFile As clsD3File
   Dim oIndex As clsD3Index
 
   Set oConn = oEnv.brOpenConnection("ODBC", "Production") 
   Set oFile = oConn.brOpenFile("customers")
 
   On Error GoTo D3ErrorHandler
 
   ' If there is not an existing index on attribute 1,
   ' then the D3ErrorHandler will create an index.
   Set oIndex = oFile.brRoot("a1")
 
   ' brMoveNext is the first index function to
   ' be performed so the index will be traversed
   ' from the beginning.
   Do While oIndex.brMoveNext
      ' brIndexId returns the item-ids from the
      ' customers file that is the customerid.
      ' brIndexKey returns the customer's name (attribute1).
      Debug.Print oIndex.brIndexId, oIndex.brIndexKey
   Loop
 
   oConn.brCloseFile oFile
   oEnv.brCloseConnection oConn
   Set oEnv = Nothing
Exit Sub
 
D3ErrorHandler:
   Select Case Err.Number
      Case d3SrvErr_NotRoot
         oFile.brCreateIndex "a1", True
      Case Else
      End
 
   End Select
   Resume
End Sub

FlashBASIC reference

D3IndexNextKey: key - with the 'n' operator

Applies to

clsD3Index class