EXECUTES THE NEXT STATEMENT OR THE NEXT BLOCK OF STATEMENTS UNTIL END_WHILE WHILE THE CONDITION C IS TRUE
ACTION
The command WHILE defines the beginning of a loop WHILE/END_WHILE. It uses the result of the logical condition (True or False) to execute or not the statement or the block of statements until the keyword END_WHILE.
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 or not the statement or the block of statements.
The command is the beginning of a loop and must be used with the keyword END_WHILE :
WHILE Condition
Statement(s)
END_WHILE
While the condition is true, the statement or the block of statements till END_WHILE is(are) executed. Otherwise, the execution jumps to the statement just after END_WHILE.
SYNTAX:
WHILE C
USE ERROR EXAMPLE
dim a
a=0
rem display all the digits from 0 to 9
while a<10
print a
a=a+1
end_while
WHILE
WHILE C
SEE ALSO
END_WHILE
IF
THEN
ELSE
END_IF
REPEAT
UNTIL
AND
OR
NOT