You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Flow Control in a Macro<br />
The block of statements is always executed at least once. Each time the UNTIL line is reached,<br />
the conditional_expression is tested. If it is TRUE, control is passed to the line following the<br />
UNTIL line. Otherwise, control is passed back to the top of the block of statements, which are<br />
executed again. The block of statements of a REPEAT loop are entered at least once, unlike<br />
those of the WHILE loop.<br />
The DO Loop<br />
The DO statement iterates a loop variable over a range of values, executing a block of macro<br />
statements on each iteration. The format of the DO statement is as follows:<br />
DO/ variable � start,<br />
end [, step ]<br />
statements<br />
ENDOF/DO<br />
The step increment does not need to be specified. It defaults to one (1). The start value, end<br />
value and step increment value are evaluated when the DO line is first reached. The loop variable<br />
is then assigned the start value. A test is performed on each iteration before executing the<br />
statements. If the loop variable has passed the end value, control passes to the statement after the<br />
ENDOF/DO. Each time the ENDOF/DO line is reached, the step increment value is added to the<br />
loop variable and the cycle repeats.<br />
If the step increment value is positive, the termination test is that the loop variable is greater than<br />
the end value. If the increment value is negative, the termination test is that the loop variable is<br />
less than the end value. For the default case in which the increment is one, the loop variable has a<br />
value of one added to it until it is greater than the end value.<br />
Exiting Loops (EXIT)<br />
The EXIT command is used to exit a given number of nested loop levels, transferring control to<br />
the statement immediately following the given loop. Each WHILE, REPEAT or DO loop that the<br />
EXIT statement is nested within counts as one level (note that IF and CASE statements do not<br />
count as a level).<br />
The format of the EXIT statement is as follows:<br />
EXIT [ / levels ]<br />
The levels value is a whole unsigned number. If not specified, the default number of levels is 1.<br />
Unconditional Jumps (JUMPTO)<br />
The JUMPTO statement is used to transfer control to a labeled statement within the same macro.<br />
The label may be above or below the JUMPTO statement. The labeled statement starts with the<br />
name of the label, followed by a colon (:). Labels must be alphanumeric. They can start with<br />
either a letter or a digit, but must contain at least one letter. The format of the JUMPTO statement<br />
is as follows:<br />
JUMPTO<br />
/ label _name<br />
�<br />
label _name<br />
:<br />
134 <strong>ICAM</strong> Technologies Corporation – Proprietary