SEQ

SEQ_ - Sequence global variables

Synopsis
${SEQ_name} ${SEQ_name:INIT} ${SEQ_name:INC}

Description
The SEQ_ global variables provide a mechanism for automatically generating a sequence of integers during the loading process. When the sequence options are referenced, the appropriate action is taken. Sequence actions are as follows.

INIT
Initialize the sequence to the value 0 before evaluating the variable.

INC
Increment the sequence value before evaluating the variable.

Example
The following GLM file


 * 1) print Initializing: SEQ_A=${SEQ_A:INIT}
 * 2) print SEQ_A=${SEQ_A}
 * 3) print Incrementing: SEQ_A=${SEQ_A:INC}
 * 4) print SEQ_A=${SEQ_A}

outputs the following text

example.glm(1): Initializing: SEQ_A=0 example.glm(2): SEQ_A=0 example.glm(3): Incrementing: SEQ_A=1 example.glm(4): SEQ_A=1

Caveat
The INC action can be applied to any global of type int32. This means that you can define a global variable of type int32 using the global directive and start with a non-zero value. For example:

global int32 SEQ_B 12;
 * 1) print ${SEQ_B:INC}

is acceptable.

Also note that using the SEQ variables in macros may result in unexpected behavior because the macros are processed before certain load functions can be processed. For example, to create multiple objects using sequences, you must use expansions rather than macros, such as

module residential; global int32 SEQ_A 0; object house:..10 { name "House_${SEQ_A:INC}"; name `House_{SEQ_A:INC}`; }

Version
The SEQ_ globals were introduced in.