EXIT

The EXIT statement can terminate FOR, FOREACH, LOOP, or WHILE statements.

Syntax


1  EXIT
1  FOREACH
1 
2.1 FOR
2.1 LOOP
2.1 WHILE
1? ?  label WHEN condition
2  ;
Element Description Restrictions Syntax
condition Loop terminates when this evaluates to TRUE. If condition evaluates to FALSE, the loop continues. Condition
label Label of a loop from which to exit Must be the label of a loop statement that includes the EXIT statement Identifier

Usage

The EXIT statement transfers control of execution from an iterative statement, causing the innermost loop of the enclosing statement type (FOR, FOREACH, LOOP, or WHILE) to terminate. If no loop label or WHEN condition is specified, execution resumes at the first statement that follows the current FOR, FOREACH, LOOP, or WHILE statement.