brItemIndex property

Returns the number of items read from the list.

Syntax

lValue = object.brItemIndex

Parameters

Parameter Description
lValue The return value is a Long data type indicating the number of items that have been read from the select list.
object An object variable that represents a clsD3SelectList object.

Returns

For RPC connections, may return a negative number indicating a partial list.

Remarks

When a clsD3SelectList object is created, brItemIndex returns 0. For each brReadnext, the brItemIndex is incremented.

Example

Private Sub TestList_Click()
   Dim oList As clsD3SelectList
   Dim sCurrent As String
   Dim i As Integer
 
   OpenConnection ' Subroutine to establish connection
 
   Set oList = oConn.brOpenSelectList("select products")
   oList.brReadnext
   MsgBox "This list was produced by the command " & oList.brName
   MsgBox "The first item is " & oList.brItemId
 
   Do While True
      Select Case InputBox("N for next, P for previous")
         Case "N"
 
         Case "If oList.brEOL Then
            MsgBox "End of list" 
            Else
            oList.brReadnext 
            If oList.brEOL Then 
            MsgBox "End of list" 
            Else 
            MsgBox "The next item is " & oList.brItemId 
            End If 
         End IfP"
            If oList.brBOL Then
            MsgBox "At beginning of list" & " - The first item is" & oList.brItemId 
            Else
            ‘ Save current position 
            sCurrent = oList.brItemIndex
            ' Since the select list can be read only in a 
            ' forward direction, begin reading from top 
            oList.brReselect 
            ' Read items up to one less than current 
            For i = 1 To sCurrent - 1 
            oList.brReadnext 
            Next i 
            MsgBox "The previous item is " & oList.brItemId 
            End If
         Case Else
            Exit Do
      End Select
   Loop
 
   oConn.brCloseSelectList oList
   CloseConnection ' Subroutine to close connection
End Sub