WHILE/LOOP
Provides iterative execution of DGL statements. The execution of statements is determined by evaluation of theboolean_expression
.WHILE a > b LOOP
.
.
b := b + k;
.
.
END LOOP;Assume thatb
changes its value inside the loop and in one of the iterations the expressiona
>
b
becomes false. In the next iteration, the expression is examined and, becausea
>
b
is nowFALSE
, the execution of template statements continues with the first statement after theEND
LOOP
.
The value ofboolean_expression
must be altered within the loop, or anEXIT
statement must be executed in order to terminate the loop.WHILE count < 25 LOOP
num_control := alpha / 5;
WRITE (count, num_control, ’\n’;
alpha := synch +7;
count := count + 1;
END LOOP;
●
●
●