Flow-control structures: Difference between revisions

→‎exit: corrected text concerning the EXIT statement, added other verbage. -- ~~~~
(→‎Goto: add a little detail about restrictions)
(→‎exit: corrected text concerning the EXIT statement, added other verbage. -- ~~~~)
Line 1,621:
=={{header|REXX}}==
===exit===
The EXIT statement terminates the running (REXX) program and passes control to the invoking program (it could be the shell/host/supervisor program). If the invoking program is a REXX program, it also is terminated.
If an expression is coded, it normally is used to set the RESULT (if a REXX program) or return code (also called returnRetCode, codeRC, completion code, or other such names).
 
Some operating systems require the expression to be a whole number within a certain range (often with a no expression or a [null] expression is usually taken to mean a return code of '''0''').
If an expression is coded, it normally is used to set the return code (also called return code, completion code, or other such names).
 
Some operating systems requireIf the expression to beis a whole number, (often with a no expression or a [null] expressionit is usually takennormalized to mean a returnthe codecurrent ofNUMERIC 0)DIGITS.
<lang rexx>exit
 
exit expression</lang>
 
===return===
The RETURN statement terminates the running (REXX) program and passes control to the invoking program (it could be the shell/host/supervisor program). If the invoking program isn't a REXX program, the RETURN statement acts like an EXIT.