ENDLOOP¶
Valid in: DBProc, TblProc
The ENDLOOP statement terminates a FOR, REPORT or WHILE loop.
The ENDLOOP statement has the following format:
The ENDLOOP statement uses the label to indicate which level of nested loops to break out of. If no label is specified after ENDLOOP, the innermost loop currently active is closed.
EXIT or LEAVE are synonyms for ENDLOOP.
The following example illustrates the use of labels in nested FOR and WHILE loops:
In this example, there are four possible breaks out of the inner loop. If condition_2 is true, both loops are closed, and control resumes at statement_list_9. If condition_2 is false, but condition_3 is true, the inner loop is exited and control resumes at statement_list_6. If condition_4 is true, then the inner loop is exited, or if condition_5 is true both loops are closed.
Permissions¶
This statement is available to all users.