Created SET symbols
- Variable symbols, optionally subscripted
- Strings of alphanumeric characters
- Predefined symbols with absolute values
- Other created SET symbols
Name Operation Operand
&X(1) SETC 'A1','A2','A3','A4'
&(&X(3)) SETA 5
&X
is
a variable whose value is the name of the variable to be updated.&A3 SETA 5
You can use created SET symbols wherever ordinary SET symbols are permitted, including declarations; they can even be nested in other created SET symbols.
The created SET symbol can be thought of as a form of indirect addressing. With nested created SET symbols, you can use such indirect addressing to any level.
Created SET symbols can also offer an associative memory
facility.
For example, a symbol table of numeric attributes can be referenced
by an expression of the form &(&SYM)(&I)
to
yield the I
-th element of the symbol substituted
for &SYM
. Note that the value of &SYM
need
not be the name of a valid symbol; thus created SET symbols may have
arbitrary names.
Created SET symbols also allow you to achieve some of the effect
of multidimensional arrays by creating a separate named item for each
element of the array. For example, a three-dimensional array of the
form &X(&I,&J,&K)
can be addressed
as &(X&I.$&J.$&K)
. Then &X(2,3,4)
is
represented as a reference to the symbol &X2$3$4
.
Note that what is being created here is a SET symbol. Both creation and recognition occur at macro-generation time. In contrast, the names of parameters are recognized and encoded (fixed) at macro-edit time. If a created SET symbol name happens to coincide with a parameter name, the coincidence is ignored and there is no interaction between the two.