#for
Generate blocks of repeated ProcScript.
#for Item =
(
List)
{,
Counter}
< Precompiler directives and ProcScript statements >
#endfor
Parameters
-
Item—constant that contains an item of List.
-
List—list of items separated by commas, spaces, or GOLD semi-colon (;)
-
Counter—constant containing a sequential number, starting with 0, identifying the position of item of Item in the List
Both Item and Counter are defined only during processing of the #for block.
Description
The #for directive generates a repeating block of ProcScript for each item in a list.
In the following example, the compile-time
constant <MYLIST>
has been defined as A,B,C
:
#for ITEM = (<MYLIST>), COUNTER message "Element <COUNTER> in the list is <ITEM>" #endfor
The ProcScript generated by this #for block is:
message "Element 0 in the list is A" message "Element 1 in the list is B" message "Element 2 in the list is C"