Returns from a subroutine or function.
RETURN[(retval)] [TO label]
statement is used to end execution of a user-defined subroutine or function and return control to the statement that invoked the subroutine or function.
statement with no argument ceases execution of a subroutine and returns control to the GOSUB
statement (for an internal subroutine) or the CALL
statement (for an external subroutine) that invoked the subroutine. Program execution resumes with the line immediately following the GOSUB
You can terminate an external subroutine with a RETURN
or with an END
statement with a TO label
clause ceases execution of a subroutine and transfers execution to the internal subroutine identified by the specified label.
statement ceases execution of a function and returns retval
to the location where the function was invoked. If no retval
is specified, an empty string is returned.
Before invoking a user-defined external function, it is necessary to locally define the function using the DEFFUN