Batch Mode Simulation : Structured SCL Statements : WHILE/LOOP and FOR/LOOP Statement

WHILE/LOOP and FOR/LOOP Statement

The WHILE/LOOP statement is used to execute SCL statements in a loop.

WHILE Boolean_expression
LOOP
statement [ ; statement . . . ]
END LOOP

The statements in the LOOP clause are performed repeatedly while the Boolean_expression is true. The Boolean_expression is checked prior to each execution of the LOOP. The Boolean_expression may include Rational Statemate elements as well as SCL variables and constants. There is no limit to the depth of nested structured statements. For example, where cax, cb and cq are conditions and a1, a2 and a3 are actions:

WHILE cax
LOOP
a1 ;
a2 ;
IF x = 3 THEN tr!(cax);
ELSE
WRITE(’not tripped \n’);
WHILE cb or cq LOOP
Go Step a3;
END LOOP;
END IF;
END LOOP;
FOR/LOOP example:
FOR i in int1 to init2 LOOP
array(i):=0;
END LOOP;
where i, Int 1 and int2 are intergers