REXX
blocks are defined in the HEAD
section
of a script and each contain a piece of REXX code. This code is assigned a
name in order to reference (call) it later on as part of other blocks.
For this purpose, there is one mandatory NAME=xyz
attribute in
the opening REXX
tag.
Example:
<REXX NAME=MyREXXCode> rc=rxFuncAdd('SysLoadFuncs',, 'REXXUTIL','SysLoadFuncs'); rc=SysLoadFuncs(); parse arg parameter . /* comments may be placed in the code */ result='ABC'||parameter||'XYZ' return result </REXX>
This example doesn't do anything useful, but it shows a number of things:
parse
function. See
"REXX Examples" about how to pass parameters.
WarpIN exports a number of built-in REXX functions that may be called from within any REXX code without loading them first. See "Exported REXX functions" for details.
Remark: There is a problem with WarpIN scripts including REXX
code and the WarpIN parser: If the parser finds any start tag, it needs
to find the corresponding end tag in order to isolate the script code block
enclosed. But if this code block happens to contain any < or > signs, it
will issue unmotivated error messages and exit. You can avoid the signs
in any text but REXX code may need them in order to work properly. A
workaround is to always provide a matching sign in a comment, such as:
if x < y then... /* > */
or
/* < */ if x > y then...