EXIT statement

Syntax

EXIT

Description

Use the EXIT statement to quit execution of a Description loop or a Description loop and branch to the statement following the NEXT or REPEAT statement of the loop. The EXIT statement quits exactly one loop. When loops are nested and the EXIT statement is executed in an inner loop, the outer loop remains in control.

Example

COUNT = 0
LOOP
WHILE COUNT < 100 DO
   INNER = 0
   LOOP
   WHILE INNER < 100 DO
      COUNT += 1
      INNER += 1
      IF INNER = 50 THEN EXIT
   REPEAT
   PRINT "COUNT = ":COUNT
REPEAT

This is the program output:

COUNT = 50
COUNT = 100