Contents - Index


 

A REXX Procedure may be invoked either from an OS/2 session or directly from BIM-EDIT/XP.

 

The REXX language is defined by OS/2 and documented in the 'Procedure Languages 2/ REXX User's Guide' manual.  Online information is also provided with OS/2 and available through the 'Information' folder (assuming online documentation was selected at installation time).

 

The purpose of this section is not to document the REXX language but to provide BIM-EDIT/XP-specific information concerning its use.

 

Active SubCommand Handler

 

Commands that are not REXX commands are passed to the active subcommand handler as opposed to being processed by the REXX interpreter.  Further, if the command is enclosed in double quotation marks ("), the command will always be routed to the active subcommand handler.  When a REXX procedure is initially invoked, the active subcommand handler is "CMD", the subcommand handler provided by OS/2 that processes OS/2 commands.  As such, if the CMD subcommand handler is active, the following command within a REXX procedure would create a directory:

 

   => "md tempdir"

 

BIM-EDIT/XP provides the subcommand handler "BIMEDIT".  When BIMEDIT subcommand handler is active, commands entered in double quotation marks are passed to BIM-EDIT/XP.  As such, if the BIMEDIT subcommand handler is active, the following command within a REXX procedure would create an edit session:

 

   => "ed apcissu.c"

 

The BIMEDIT subcommand handler is available only if the REXX procedure is invoked from BIM-EDIT.

 

To switch the active subcommand handler, the REXX ADDRESS command is used. For example, to switch to BIMEDIT, enter:

 

   => address bimedit

 

To switch back to CMD, enter:

 

   => address cmd

 

Access to BIM-EDIT/XP Variables

 

A REXX Procedure can access BIM-EDIT/XP Predefined Variables through the VAL function.  For example, to assign the contents of the current line to variable WORK, enter:

 

   => work = val("curline");

 

Return Information

 

Return information (i.e., return code, text, etc.) supplied by or to BIM-EDIT/XP is of the following format:

 

Cols 1-2: Return code.  "OK" for success.  Otherwise, determined by BIM-EDIT/XP command or the REXX procedure.

Cols 3-4: Sense code.  May be supplied to further qualify a return code.

Cols 6-6: Error level.  "1" for normal errors, "2" for severe errors.

Cols 7-7: Message level.  "1" for success messages, "2" for warning messages, "3" for error messages.

Cols 9+: Message text.

 

When a BIM-EDIT/XP command returns control to REXX, the REXX variable RC is set in the above format.

 

When a REXX procedure terminates after being invoked from BIM-EDIT/XP, it should supply a value in the above format as an operand on the REXX RETURN statement.