exit if truth-value-expression
A logical expression that evaluates to true or false.
|
If the logical expression is
true, G2 executes the exit if statement and transfers control to the statement immediately following the loop. If false, G2 does not execute the exit if statement and continues processing the loop. exit if statement within a nested loop, its effect is to transfer control back to the loop immediately enclosing it. For example:
for var-1 = 1 to 5
do
for var-2 = 1 to 5
do
exit if var-2 = 3
end;
statement-1;
end;
statement-2;
exit if statement (when var-2 has the value 3), it will continue processing with statement-1, rather than statement-2.