RETURN statement

Purpose

Return from a (GOSUB) subroutine to its caller.

Syntax

RETURN

Remarks

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

Performing a RETURN without a corresponding GOSUB can cause unexpected behavior and difficult-to-track errors, including the possibility of a General Protection Fault (GPF) in Windows.

See also

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

Example

See the example in GOSUB.