![[About]](r:\html\rexxabout.gif)
![[Toc]](r:\html\rexxtoc.gif)
0.9b (c) 1995 Peter Childs
>>----CALL---+---name----+--------------------------+-----;-><
| | +------,-------+ |
| | v | |
| +---+--expression--+-------+
| |
+---OFF-----+--ERROR------+------------+
| +--FAILURE----+ |
| +--HALT-------+ |
| +--NOTREADY---+ |
| |
+--ON--+-ERROR----+-+---------------+--+
+-FAILURE--+ +-NAME-trapname-+
+-HALT-----+
+-NOTREADY-+
CALL is used to invoke a routine (if you specify name) or to control the trapping of certain conditions (if ON or OFF is specified)
To control trapping, specify OFF or ON and the condition you want to trap. OFF turns off the specified condition trap. ON turns on the specified condition trap.
To invoke a routine, specify name, which is a symbol or literal string that is taken as a constant. The name must be a valid symbol. The routine invoked can be any of the following:
o An internal routine o An external routine o A built-in function.
If a string is used for name (that is, name is specified in quotation marks) the search for internal labels is bypassed, and only a built-in function or an external routine is invoked. Note that the names of built-in functions (and generally the names of external routines too) are in uppercase; therefore, the name in the literal string should be in uppercase.
The routine can optionally return a result and is functionally identical to the clause:
>>-result=name(-+--------------------+-)--;--><
| +------,--------+ |
| v | |
+-++------------+-+--+
+-expression-+
The exception is that the variable result becomes uninitialized if no result is returned by the routine invoked.
The name given in the CALL instruction must be a valid symbol.
The OS/2 interpreter supports the specification of up to 20 expressions, separated by commas. The expressions are evaluated in order from left to right, and form the argument strings during execution of the routine. Any ARG or PARSE ARG instructions or ARG built-in function in the called routine will access these strings rather than those previously active in the calling program. You can omit expressions, if appropriate, by including extra commas.
The CALL then causes a branch to the routine called name using the same mechanism as function calls. The order in which these are searched for is described in the section on functions. A brief summary follows:
Internal routines: These are sequences of instructions inside the same
program, starting at the label that matches name in
the CALL instruction. If the routine name is
specified in quotation marks, then an internal
routine is not considered for that search order.
Built-in routines: These are routines built in to the language processor
for providing various functions. They always return
a string containing the result of the function.
External routines: Users can write or make use of routines that are
external to the language processor and the calling
program. An external routine can be written in any
language, including REXX, that supports the
system-dependent interfaces. If an external routine,
written in REXX, is invoked as a subroutine by the
CALL instruction, you can retrieve any argument
strings with the ARG or PARSE ARG instructions or the
ARG built-in function.
Inf-HTML End Run - Successful