END_WHILE

END_WHILE

ENDS THE STATEMENT OR THE BLOCK OF STATEMENTS TO BE EXECUTED FROM THE COMMAND "WHILE"

  • Type: Command
  • Parameter: 0
  • Group: Structures

ACTION

The command END_WHILE defines the end of a loop WHILE/END_WHILE. It is used to define the end of the statement or the block of statements to be executed when the logical condition of WHILE is true.

While the condition is true, all the commands till END_WHILE are executed. Otherwise, the execution jumps to the statement just after 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 following statements.

SYNTAX: END_WHILE

  • in:
  • WHILE C
  • command(s)
  • END_WHILE
  • C: logical expression.

USE

  • END_WHILE is used, associated to WHILE, to mark the end of the statement or the block of statements to be executed when the logical condition is true.

ERROR

  • If C is not a correct logical expression.
  • If there is no WHILE before END_WHILE.

EXAMPLE

dim a%

a%=0

rem display the digits from 0 to 9

while a%<10

print a%

a%=a%+1

end_while

SEE ALSO

WHILE

IF

THEN

ELSE

END_IF

REPEAT

UNTIL

AND

OR

NOT