basic.return Statement/BASIC Program

basic.return

Command basic.return Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description terminates an internal or external subroutine and returns execution control to the statement following the invoking "call" or "gosub" statement.

The "to" clause may only be used with an internal subroutine, and transfers control to the specified statement label. This is not considered a good programming practice.
Syntax return
return { to statement.label }
Options
Example
input answer
if answer = 'y' then gosub 1000
print 'back again'
stop
1000 * subroutine
print 'ok'
return

In this example, if the answer is "y" then call internal subroutine 
1000.  When 1000 is complete, control is "returned" to the line which 
prints "back again".
Purpose
Related basic.gosub
basic.on.gosub
basic.call
basic.subroutine
basic.statement.labels