Command Reference : Function Reference : Function Reference: A
  
 
@attrvals
Attribute values in workfile page.
Syntax: @attrvals(attr[, obj, opt])
attr: string
obj: (optional) string
opt: (optional) integer
Return: string
Returns a string list of all attribute values in the active workfile page that match the attr pattern and, optionally, whose object names also match the obj name pattern.
The attr is a space delimited list of attribute value patterns. The list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns.
The obj list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns separated by spaces.
The opt is an integer value indicating how a “*” or “?” in the attr should be treated when matching. Use “0” to treat the characters as wildcards, and “1” to treat the characters as literals.
Matches are not case-sensitive.
Examples
If a workfile contains three objects named “GDP”, “UNEMP”, and “INFLATION”, each object contained a “month” attribute where the GDP “month” values was “Jan”, the UNEMP value was “Feb”, and the INFLATION value was “Mar”, then
@attrvals("M*")
return the string list “Mar”. All attributes values for all objects in the workfile that begin with “M” are included. Alternatively,
@attrvals("M* D*", "GDP")
returns the list of attribute values for the object GDP that begin with “M” and “S”.
If a fourth object INTEREST has an attribute value “*Mar” for “month,” the command
@attrvals("*mar", "*")
will return “*mar mar”, since by default, the “*” in “*mar” is treated as a wildcard and the value “Mar” from INFLATION and value “*Mar” from INTEREST match.
However, the command
@attrvals("*mar", "*", 1)
will only return “*mar”, since the “*” in “*Mar” is treated as a literal for purposes of matching, and only “*Mar” from INTEREST matches.
Cross-references
See also @attrnames, @wfattrnames, and @wfattrvals.