Syntax
Leaves the innermost loop at once. The program continues after its NEXT, ENDWHILE, UNTIL or LOOP.
EXITGood to know
- It acts on the innermost FOR, FOREACH, WHILE, REPEAT or DO loop. Inside a SELECT, it leaves the loop around the SELECT, not only the SELECT.
- Outside any loop it is a compile error: "EXIT without an active loop". That includes a SELECT that is not inside a loop.
- There is one spelling.
EXIT FOR,EXIT WHILE,EXIT DOandBreakare not supported:EXIT FORcompiles, but the program does not start. WriteEXIT. EXITleaves one loop. To leave two nested loops, set a flag and test it in the outer loop, or jump forward with GOTO.- To leave a FUNCTION, use
EXITFUNCTION, notEXIT.