ISolveInterface.ListItems (method)

List the items of item type that pass the expression.
Syntax: SCODE = object.ListItems ( itemType, expression, data )
Parameters:
itemType As String - The item type to be used with the expression.
expression As String - The expression used in generating the list of matching items.
data As VARIANT* - Pass in an existing CoCimSafeArray3 object. It will be filled in with an array of VARIANTs containing the matching items. (Note: In VBScript and VBA/VB, you may pass a Variant and this function will return a native array.)
Description: browser.ListItems creates a list of items that match the expression. If there are no problems with the database then a value of S_OK is returned. If there are problems then a value of S_FALSE is returned. If the array is empty then no matching items were found.


Example

Dim i As Variant
Dim errorCode As Long
Dim errorString As String
Dim low As Long
Dim high As Long
Dim items As Variant
Set items = CreateObject("CIMPLICITY.CimSafeArray.3")
i = browser.ListItems("VEHICLE ORDER", "Order Card.C=l'c%'", items)
If CInt(i) = 0 Then
  items.GetArrayBounds 1, low, high
  For j = low To high
    MsgBox "List items " + CStr(j) + " =" + CStr(items.Element(j))
  Next j
Else
  i = browser.LastError(errorCode, errorString)
  MsgBox "Error code = " + CStr(errorCode) + ", Error string = " + errorString
End If