Exiting Processing Blocks

The following statements are used for program-controlled exit from processing blocks: RETURN, EXIT, CHECK, REJECT, and STOP. These statements end the processing block immediately. Depending on which processing block the statement is executed in, the runtime environment normally behaves according to the following schema, although exceptions in the individual statements must be noted.

In addition to the statements described here, statements that call other units without returning to the caller after the call is made, also end their processing block. These are:

Messages and the triggering of exceptions can also end processing blocks.

Note

Leaving a procedure by pressing RETURN (or EXIT or CHECK) is the trouble-free way to end the procedure. Formal parameters for which the pass by value is defined are not passed to the assigned current parameters only if the procedure terminates after an error (an exception is triggered or a message is sent).