Command Reference : Programming Language Reference
  
 
@wlookup
Syntax: @wlookup(name_pattern_list[, object_type_list, attribute_pattern, attribute_search_options])
Argument 1: string list, name_pattern_list
Argument 2: string list, object_type_list
Argument 3: string list, attribute_pattern
Argument 4: int, attribute_search_options
Return: string list
Returns a string list of all objects in the workfile or database that satisfy the pattern_list and, optionally, the object_type_list, attribute_pattern, or attribute_search_options.
The name_pattern_list may be made up of any number of “?” (indicates any single character) or “*” (indicates any number of characters) name patterns separated by spaces. The pattern must exactly match the object name in the workfile or database.
The object_type_list is a space delimited list containing one or more object types. The default is “*”. Object types are "*", "SAMPLE", "SVECTOR", "EQUATION", "GRAPH", "TABLE", "TEXT", "PROGRAM", "MODEL", "SYSTEM", "VAR", "STRING", "POOL", "SSPACE", "LOGL", "ALPHA", "VALMAP", "FACTOR", "SPOOL", "GRAPH", "USEROBJ", "GROUP+DATA", "GROUP", "SCALAR", "MAT/VEC/SYM", "COEFLIST","GROUP", "MATVECLIST", "SYM", "MATRIX", "VECTOR", "COEF", "SERIES", "LINK", "DIGRAPH", "GEOMAP", "STRING", "FORMULA", "DATABASE", and "WORKFILE".
The attribute_pattern is a space delimited list of attribute=attribute_value patterns. The default is “”.
The attribute_search_options is an integer value indicating how a “*” in the attribute_pattern should be treated when matching. Use “0” to treat “*” as a wildcard and “1” to treat “*” as a literal. The default is “0”.
NOTE: when specifying an optional argument, the preceeding optional argument(s) must also be specified. For example, if an attribute_search_option is specified, object_type_list and attribute_pattern must also be specified.
Examples
If a workfile contains three graph objects named “GRA1”, “GRA2”, and “GRA01”, one group object named “GRO1”, and two series objects named “SR1” and “SER2”, then
@wlookup("GR*")
returns the string list “GRA01 GRA1 GRA2 GRO1”. All objects beginning with “GR” and followed by any number of characters are included. Alternatively,
@wlookup("?R*")
returns the string list “GRA1 GRA2 GRA01 GRO1 SR1”. SER2 is not included because “?” specifies a single character preceding an “R”.
@wlookup("?R?","series")
returns the string “SR1”. The object type “series” drops all graph objects from the list, and “?R?” filters out SER2 because “?” specifies a single character.
Now let us assume for the same workfile:
GRA1 had the attributes “Month” and “Author” with values equal to “September” and “Sam”.
GRA2 had the attribute “Author” with value equal to “Sam”.
GRA01 had the attributes “Month” and “Author” with values equal to “January” and “Mary”.
GRO1 had the attribute “Month” with value equal to “September”.
SRO1 had the attribute “Mon” with value equal to “January”.
SER2 had the attributes “Month” and “Author” with values equal to “June” and “Sam”.
Similar to the previous examples, we will further limit the results by adding some attribute filters
@wlookup("GR*", "*”, "Month=J*")
returns the string list “GRA01”. “GRA01” was the only object that had the “Month” attribute value beginning with “J”.
@wlookup("*", "*", "Month=September Month=J*")
returns the string “GRA01 GRA1 GRO1 SER2”. All objects either had a “Month” equal to “September” or “Month” beginning with “J”.
@wlookup("*", "GRAPH", "Month=September Month=J*")
returns the string “GRA01 GRA1”. Only graph objects which either had a “Month” equal to “September” or “Month” beginning with “J” are included.
@wlookup("*", "*", "Month=*")
returns the string “GRA01 GRA1 GRO1 SER2”. All objects have a “Month” attribute whereby the value is ignored.
@wlookup("*", "SERIES", "Month=*")
returns the string “SER2”. Only the series objects which have a “Month” attribute are included.
@wlookup("*", "*", "M*th=September")
returns the objects which have attributes beginning with “M” and ending with “th”. This returns the string “GRA1 GRO1”.