EXIT - IBM-REXX

exit

EXIT leaves a program unconditionally.Optionally EXIT returns a character string to the caller.The program is stopped immediately, even if an internal routine is currently being run.If no internal routine is active, RETURNand EXIT are identical in their effect on the program that is being run.

If you specify expression, it is evaluated and the string resulting from the evaluation is passed back to the caller when the program stops.

Example:

j=3
Exit j*4
/* Would exit with the string ’12’ */

If you do not specify expression, no data is passed back to the caller. If the program was called as an external function, this is detected as an error—either immediately (if RETURN was used), or on return to the caller (if EXIT was used).

“Running off the end” of the program is always equivalent to the instruction EXIT, in that it stops the whole program and returns no result string.

Note:

If the program was called through a command interface, an attempt is made to convert the returned value to a return code acceptable by the host.If the conversion fails, it is deemed to be a failure of the host interface and thus is not subject to trapping with SIGNAL ON SYNTAX. The returned string must be a whole number whose value fits in a general register (that is, must be in the range -2**31 through 2**31-1).


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-REXX Topics