pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

condition
is either:
A conditional expression
An INT, INT(32), or FIXED arithmetic expression. If the result of the arithmetic expression
is not 0, condition is true. If the result is 0, condition is false.
If condition is false, the DO-UNTIL statement continues to execute. If condition is true,
the statement following the DO-UNTIL statement executes.
A DO-UNTIL statement always executes at least once (unlike the WHILE (page 232)).
In Example 153 (page 211), the DO-UNTIL statement loops through array_a, testing the content
of each element until an alphabetic character occurs.
Example 153 DO-UNTIL Statement
index := -1;
DO index := index + 1 UNTIL $ALPHA (array_a[index]);
In Example 154 (page 211), the DO-UNTIL statement loops through array_a, assigning a 0 to
each element until all the elements contain a 0.
Example 154 DO-UNTIL Statement
LITERAL limit = 9;
INT index := 0;
STRING .array_a[0:limit];y
DO
BEGIN ! Compound statement to execute in
array_a[index] := 0; ! DO loop
index := index + 1;
END
UNTIL index > limit; ! Condition for ending loop
The conditional expression cannot reference hardware indicators (<, <=, =, <>, >, >=, '<', '<=',
'=', '<>', '>', '>=', $OVERFLOW, and $CARRY). Only IF statements can test hardware indicators.
For more information, see Chapter 13 (page 234).
To use a hardware indicator’s value to control a DO-UNTIL loop, save the hardware indicator’s
value and either test the saved value (as in Example 155 (page 212)) or execute an explicit GOTO
statement to exit the loop (as in Example 156 (page 212)). Hardware indicators cannot appear in
the conditional expression of a DO-UNTIL statement.
DO-UNTIL 211