EXECUTES AGAIN THE STATEMENT OR THE BLOCK OF STATEMENTS FROM REPEAT UNTIL THE CONDITION C IS TRUE
ACTION
The command UNTIL defines the end of a loop REPEAT/UNTIL. It uses the result of the logical condition (True or False) to execute again or not the statement or the block of statements from the keyword REPEAT.
If the result is false, the loop is executed again.
If the result is true, the statement following UNTIL is executed.
The "condition" is a single logical expression (built with comparators >, <, >=, <>, =, ...) or a complex expression combined with logical operators AND, OR, NOT and parenthesis. Only the result (True or False) is used to execute again or not the the statement or the block of statements.
This command is the end of a loop and must be used with the command defining the beginning of the loop : REPEAT.
REPEAT
Statement(s)
UNTIL Condition
The statement or the block of statements till UNTILL is executed. Otherwise, the execution jumps to the statement just after UNTIL.
SYNTAX:
UNTIL C
USE ERROR EXAMPLE
dim a
a=0
rem display all the digits from 0 to 9
repeat
print a
a=a+1
until a=10
UNTIL
UNTIL C
SEE ALSO
WHILE
END_WHILE
IF
THEN
ELSE
END_IF
REPEAT
AND
OR
NOT