RETURN Verb - Terminate GOSUB Subroutine

Syntax

RETURN
RETURN expr

Description

The RETURN verb terminates a subroutine called by a GOSUB, and program execution resumes at the statement following the corresponding GOSUB. If the stack area is empty, or if the top entry is not a GOSUB, PRO/5 issues an error; otherwise, the top entry of the FOR/GOSUB stack is popped, and PRO/5 continues at the verb following the GOSUB. Use RETURN to leave an escape-handling routine activated by a SETESC.

A RETURN statement with an expression returns a result from a multiline function. See the DEF verb and the FN() function for additional information.

RETURN is not permitted in console mode. In a compound statement, only ELSE, FI, or REM may follow RETURN.

Examples

13000 GOSUB 29500
13110 LET TITLE$="PROGRAM NAME"

29500 LET A=50; LET B=A*C/2; PRINT TITLE$
29600 RETURN

See Also

Verbs - Alphabetical Listing