RETURN

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

This statement causes program execution to continue at the next statement after a GOSUB command was issued. RETURN is the last statement in a block of code that is called by the GOSUB command.
See GOSUB

Syntax

  1. return

Hints

If the program flow encounters a RETURN statement without having encountered a GOSUB statement before, you receive a Return without Gosub error.

Example

    print

' send program to a gosub routine
    print "leaving main program ..."
    gosub [myBranchLabel]
 
' back from gosub routine
    print "I'm back!"
end
 
' the gosub label
[myBranchLabel]
    print "entered procedure ..."
    print "working ..."

' go back to line following gosub
    print "leaving procedure ..."
return

Useful Procedures

' Place a useful function or sub using this keyword here