RETURN statement  

Purpose

Return from a (GOSUB) subroutine to its caller.

Syntax

RETURN

RETURN FLUSH

Remarks

RETURN terminates the execution of a subroutine, and passes control to the statement directly following the calling GOSUB statement.

RETURN FLUSH removes the most recent return address from the system stack and program flow continues normally after the RETURN FLUSH.

Performing either form of RETURN without a corresponding GOSUB can cause unpredictable behavior and difficult-to-track errors.  This includes the possibility of a General Protection Fault (GPF).

See also

CALL, GOSUB, GOTO, ON ERROR, SUB/END SUB

Example

See the example in GOSUB.