EXIT_FOR

EXIT_FOR

IN A LOOP FOR/NEXT, JUMPS TO THE STATEMENT JUST AFTER NEXT

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

ACTION

The command EXIT_FOR ends a loop FOR/NEXT by executing the statement just after NEXT. It must belong to a loop FOR/NEXT, and must be between a FOR and a NEXT statements.

SYNTAX: EXIT_FOR

USE

  • EXIT_FOR is used, associated to FOR and NEXT, to exit the loop.

ERROR

  • If EXIT_FOR is not between a FOR and a NEXT statements.
  • If there is no loop FOR/NEXT.

EXAMPLE

dim a%

for a%=0 to 10

print a%

if a%=5 then exit_for

next a%

SEE ALSO

FOR

TO

STEP

NEXT

EXIT_WHILE

EXIT_REPEAT