EXIT (leave a ROUTINE)

Top  Previous  Next

 

EXIT

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