List the items of item type that pass the expression. | |
Syntax: | SCODE = object.GetListValues ( itemType, expression, attributeList, values ) |
Parameters: |
itemType As
String - The item type of the
items to be searched.
expression
As String - The expression used
in generating the list of matching items.
attributeList As String - The list of attributes to look for
for each matching item.
values As
VARIANT* - Pass in an existing
CoCimSafeArray3
object. It will be filled in with a two dimensional array of
VARIANTs. Column one contains the item id that the attribute
belongs to. Column two contains the index of the attribute. Column
three contains the data as a VARIANT. This will be the value
VT_NULL if the entry in the database is NULL. Column four contains
the data's type as a string. (Note: In VBScript and VBA/VB, you may
pass a Variant and this function will return a native array.)
|
Description: | browser.GetListValues creates a list of
items that match the expression and queries the database to find
the matching attributes for the matching items. If successful
return S_OK and a variant array. If the query fails then a value of
S_FALSE is returned. If the array is empty then no values were
returned. Example Dim i As Variant Dim errorCode As Long Dim errorString As String Dim low As Long Dim high As Long Dim values As Variant Set values =
CreateObject("CIMPLICITY.CimSafeArray.3") i = browser.GetListValues("VEHICLE ORDER", "Order
Card.C=l'c%'", "Order Card.C;Order Card.Master Blend Date",
values) If CInt(i) = 0 Then values.GetArrayBounds 1, low, high MsgBox "Number of values = " + CStr(high - low +
1) For j = low To high If IsNull(values.Element2(j, 1))
Then MsgBox "Id = " +
CStr(values.Element2(j, 0)) _ +
", Index = " + CStr(values.Element2(j, 1)) _ +
", Data = <NULL>" _ +
", Type = " + CStr(values.Element2(j, 3)) Else MsgBox "Id = " +
CStr(values.Element2(j, 0)) _ +
", Index = " + CStr(values.Element2(j, 1)) _ +
", Data = " + CStr(values.Element2(j, 2)) _ +
", Type = " + CStr(values.Element2(j, 3)) End If Next Else i = browser.LastError(errorCode,
errorString) MsgBox "Error code = " + CStr(errorCode) + ",
Error string = " + errorString End If |