Previous Next Chapter

Running ARexx Programs

The RX command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and REXX: are checked.

As long as your programs is stored in the REXX: directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:

RX Program.rexx

is the same as:

RX Program

A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.

RX "DO i=1 to 5;
ADDRESS command `copy myfile.' | | i `prt:'; END"

When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application's documentation for more information.

ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the RX command as the Default Tool for the icon. In the icon's Information window, enter:

Default Tool: SYS:Rexxc/RX

When the icon is opened, RX starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.

ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon's Information window as:

Console=CON:0/0/640/200/Example/Close
CMD=rexxprogram

Top Previous Next Chapter