User Tools

Site Tools


exit_leave_a_routine_.htm
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

exit_leave_a_routine_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1