loop statements
loop statements
Scripts support loop statements. The possible syntax is:
DO WHILE expr statements LOOP
DO UNTIL expr statements LOOP
DO statements LOOP WHILE expr
DO statement LOOP UNTIL expr
Statements will be executed WHILE expr is true, or UNTIL expr is true. if expr is before statements, then the control condition will be tested before iteration. Otherwise, control condition will be tested after iteration.
Examples:
DO
K = I mod J
I = J
J = K
LOOP UNTIL J = 0
DO UNTIL I >= 0
(**Some code here**)
LOOP
DO
K = I mod J
I = J
J = K
LOOP WHILE J <> 0
DO WHILE I < 0
(**Some code here**)
LOOP