Command Reference : Function Reference : Function Reference: A
  
 
@attrnames
Attribute names in workfile page.
Syntax: @attrnames(attr[, obj, opt])
attr: string
obj: (optional) string
opt: (optional) integer
Return: string
Returns a string list of all attribute names 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. The default is “0”.
Matches are not case-sensitive.
Examples
If a workfile contains three objects named “GDP”, “UNEMP”, and “INFLATION”
@attrnames("M*")
returns the list of attributes of GDP, UNEMP, INFLATION that begin with “M”. Alternately,
@attrnames("M* S*", "GDP")
returns the list of attributes for the object GDP that begin with “M” and “S”.
If GDP had an attribute named “*Note” and UNEMP had an attribute named “footnote” the command
@attrnames("*NOTE", "*")
will return “*Note footnote” since by default, the “*” in “*Note” is treated as a wildcard. However, the command
@attrnames("*NOTE", "*", 1)
will return “*Note”, since the “*” in “*Note” is treated as a literal.
Cross-references
See also @attrvals, @wfattrnames, and @wfattrvals.