pkg_names(X)
Returns a single, indexed list-value containing the key values from a specified package variable.
Syntax
pkg_names(X)
Input
| Argument | Type | Description |
|---|---|---|
X |
any | A valid package variable |
Return Value
Returns a single list-value that contains the names of the keys in a package.
If X is N/A, an error is returned.
Sample Usage
As an example, the following Macro Language code:
<set package_keys="{pkg_names(pkg('a' 'b' 'c'; 1 2 3))}"/>
sets the variable package_keys to a list-value that contains the names of
the keys in the package: a, b, and c.
The following <willbe> operation:
<willbe name="test" value="'{@package_keys.1}'"/>
creates a column whose value is the first element in the package_keys
list, which in this case is the value a.
Example
The return value of pkg_names(X) is a list-value like those created by the
lst(X) function.
<letseq stooges="{pkg('stooge_1' 'stooge_2' 'stooge_3';'Larry' 'Curly' 'Moe')}" keys="{pkg_names(@stooges)}">
<foreach stooge_num="{@keys}" tally_="@i">
<willbe name="stooge_{@i}" value="'{@stooges.{@stooge_num}}'"/>
</foreach>
</letseq>
