User Guide
Syntax
The while loop has the following syntax.
while conditional_expression do
statement_sequence
end do;
>
A while loops repeats until its boolean expression conditional_expression
evaluates to false or FAIL. For more information on boolean expressions,
see Conditional Execution (if Statement) (page 322).
Example
The following loop computes the digits of 872, 349 in base 7 (in order of
increasing significance).
x := 872349:>
while x > 0 do
irem(x, 7);
x := iquo(x, 7);
end do;
>
330 • 8 Basic Programming