Constructing variable names

In most cases, variables are referenced directly by their name, such as {List_6}. In some cases it may be convenient to use another variable to construct a variable name and then resolve the name when a command is interpreted.

For example, suppose the variable {Num} contains the value 6. We can use the <set/> command to resolve the name of the target variable:

<set var="List_{Num}" string="6th value"/>

Use the copy option to retrieve the value of a variable with a constructed name. For example:

<set var="Temp" copy="List_{Num}" />
[Warning] Warning

It is a fatal error if a copy attribute does not resolve to a valid variable name. It is a runtime error if the named variable does not exist.

It is not valid to use variables as command or attribute names as in:

<set var="Cmd" string="rule" />
<{Cmd} width="2in" /> <!-- WRONG -->