Flow-control structures: Difference between revisions

→‎return: updated the verbage for the REXX return statement. -- ~~~~
m (→‎signal: expanded list of REXXes that support more symbol characters, comment added for signal on/off LOSTDIGITS. -- ~~~~)
(→‎return: updated the verbage for the REXX return statement. -- ~~~~)
Line 1,635:
The RETURN statement terminates the running (REXX) program (which could be a subroutine or function) and passes control to the invoking program (it could be the shell/host/supervisor program).
 
If theno invokinginternal programsubroutine isn'tor afunction REXXis programactive, the RETURN statementis actsequivalent like anto EXIT statement.
 
If a subroutine is active (a CALL was used) control goes to the instruction after the CALL.
If the invoker is a REXX program and the RETURN statement has no EXPRESSION coded, and the invoker expects a RESULT, a SYNTAX condition (error) is raised --- which usually results in an abnormal termination of the invoking REXX program (this condition can be trapped, however).
 
If a function is active (a function reference was used) control goes back to the expression evaluation using the value resulting from the RETURN's expression.
<lang rexx>return