Navigation:  Language Reference > 12 - Execution Control > Execution Control Statements >====== EXIT (leave a ROUTINE) ====== Previous pageReturn to chapter overviewNext page

 

EXIT

blk2blue.jpg

The EXIT statement immediately leaves a ROUTINE and returns program control to the statement following the DO statement that called it. This is different from RETURN, which completely exits the PROCEDURE even when called from within a ROUTINE.

An EXIT statement is not required. A ROUTINE with no EXIT statement terminates automatically when the entire sequence of statements in the ROUTINE is complete.

Example:

CalcNetPay ROUTINE

IF GrossPay = 0   !If no pay

EXIT             ! exit the routine

END

NetPay = GrossPay - FedTax - Fica

QtdNetPay += NetPay

YtdNetPay += NetPay

See Also:

DO

RETURN