26.12.2012 Views

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

ICAM Virtual Machine V19 - Kxcad.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />

The Macro Language, Flow Control in a Macro<br />

TRUE and there is no ELSE block, no blocks of statements are executed. After a block of<br />

statements is executed, control passes to the statement after the “ENDOF/IF” line.<br />

The CASE Statement<br />

A CASE statement allows the user to branch to different blocks of macro code depending on the<br />

value of one expression. It is similar to a complex IF block. The syntax of the CASE statement is<br />

as follows:<br />

1:<br />

n<br />

CASE/ any_expres sion<br />

� 1:<br />

n<br />

�<br />

WHEN/<br />

� statements<br />

�WHEN/OTHER<br />

S �<br />

�� statements �� ENDOF/CASE<br />

�constant [, THRU, constant ] �<br />

�<br />

�<br />

�<br />

The CASE line defines the expression that will be used for comparison against the constants<br />

defined on the WHEN lines. If a WHEN constant matches the CASE expression, the lines<br />

following the WHEN statement are executed up until the next WHEN statement or the<br />

ENDOF/CASE line. The OTHERS keyword following the last of the WHEN statements is<br />

similar to the ELSE statement in the IF block; it matches any remaining conditions. The OTH-<br />

ERS line is optional.<br />

The WHEN statement can list multiple constants and/or ranges of constants. The THRU keyword<br />

specifies a range of constants starting at the value specified before THRU and ending at the<br />

value specified after THRU. Any type of constant can be checked for in a WHEN statement,<br />

with the restriction that the same type of constant be used on both sides of a THRU qualifier.<br />

The WHILE Loop<br />

A WHILE loop describes a block of macro lines to be executed while a given condition is<br />

TRUE. The format of a WHILE loop is as follows:<br />

WHILE/ conditiona l_expressi on<br />

statements<br />

ENDOF/WHIL E<br />

The conditional_expression is tested before entering the block of macro lines. If the condition is<br />

FALSE, control passes to the line following the ENDOF/WHILE line. Otherwise, if the condition<br />

is TRUE, the first line following the WHILE line is executed. When the ENDOF/WHILE<br />

line is reached, control is passed back to the WHILE line, which tests its condition again. The<br />

block of macro lines of the WHILE loop are never entered if the condition is initially FALSE.<br />

The REPEAT Loop<br />

A REPEAT loop describes a block of macro lines to be executed until a given condition is<br />

TRUE. The format of a REPEAT loop is as follows:<br />

REPEAT<br />

statements<br />

UNTIL/ conditiona l_expressi on<br />

<strong>ICAM</strong> Technologies Corporation – Proprietary 133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!