ISolveInterface.ListNamedExpressions (method)

Returns a list of expressions based on the search criteria.
Syntax: SCODE = object.ListNamedExpressions ( itemType, name, expression, returnVals )
Parameters:
itemType As String - A string used to filter by item type.
name As String - A string used to filter by name.
expression As String - A string used to filter by expression.
returnVals As VARIANT* - Pass in an existing CoCimSafeArray3 object. It will be filled in with a two dimensional array containing VARIANTs. Column one contains the item type. Column two contains the name of the expression. Column three contains the expression text. Column four contains the revision of the expression. (Note: In VBScript and VBA/VB, you may pass a Variant and this function will return a native array.)
Description: browser.ListNamedExpressions returns a variant array of matching expressions. 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 expressions were found.


Example

Dim i As Variant
Dim errorCode As Long
Dim errorString As String
Dim retValArray As Variant
Set retValArray = CreateObject("CIMPLICITY.CimSafeArray.3")
Dim low As Long
Dim high As Long
i = browser.ListNamedExpressions("VEHICLE ORDER", "", "", retValArray)
If CInt(i) = 0 Then
  retValArray.GetArrayBounds 1, low, high
  For j = low To high
    MsgBox "ListNamedExpressions " _
           + "ItemType = " + CStr(retValArray.Element2(j, 0)) + " " _
           + ", Name = " + CStr(retValArray.Element2(j, 1)) + " " _
           + ", Expression = " + CStr(retValArray.Element2(j, 2)) + " " _
           + ", Revision = " + CStr(retValArray.Element2(j, 3))
  Next
Else
  i = browser.LastError(errorCode, errorString)
  MsgBox "Error code = " + CStr(errorCode) + ", Error string = " + errorString
End If