Operating System Graphical Interface
[Operating System AmigaDOS ARexx System Tools Utilities]

ARexx Commands

Address STRING/M VALUE/K
This is used to access an external program from the ARexx script. With no arguments, this toggles between the currently accessed external program and the previous external program. This is the same as the Shell command.
STRING Specifies a new external program as the host program. With an optional command, may be used to pass an argument to the host.
VALUE This defines an expression to set the new external host program.

Arg VARIABLE/M
This command will return the arguments stored in the list of parameters passed to a program. The number of arguments can be from 1 to 15. The arguments are then returned in all uppercase characters.
VARIABLE The variable name of the given argument.

Break
This command will terminate execution of a DO loop or a string that is being parsed with the INTERPRET command.

Call FUNCTION/A ARGUMENT/M
This is used to call a function from ARexx, and allows the script to pass any number of arguments to the called function. The return values will be stored in the variable RESULT, if any.

Do EXPRESSION/A TO/K BY/K FOR/K FOREVER/S WHILE/K UNTIL/K
This denotes the beginning of a block of code or an iterative loop.
EXPRESSION An ARexx statement used to initialize the counter during an iterative loop.
TO Sets the case for which loop is halted.
BY Defines how to increment an iterative loop, defaulting to 1.
FOR The maximum number of iterations.
FOREVER Performs the loop infinitely or until a Leave or Break command is used.
WHILE Sets a boolean case for which the loop continues.
UNTIL Sets a boolean case for which the loop halts.

Drop VARIABLE/M
This is used to initialize a variable to an undefined state. When a variable is uninitialized, it contains its own variable name.

Echo STRING/S
This command may be interchanged with the Say command. The STRING and values may be written in any sequence, and may appear any number of times. STRING must be delimitted with single or double quotes.
STRING A string to be output.

Else EXPRESSION/F
This is used with an IF command to provide an alternate case when performing the test of the IF command.
EXPRESSION A valid ARexx expression.

End VARIABLE/A
This allows an ARexx program to delimit a Do block or Select block. The optional VARIABLE is used to specify which iterative block is being delimited.
VARIABLE Optional variable defining the Do loop to be delimited.

Exit EXPRESSION/A
This command is used to halt execution of an ARexx program from any point within the program. Optionally, a value can be returned to the calling routine or program.
EXPRESSION Optional value to be returned by the program.

If EXPRESSION/A Then STATEMENT/A Else STATEMENT/F
This conditional tests the value of the EXPRESSION, and upon a true result will execute the STATEMENT or block contained there. The Else command is optional.
EXPRESSION An expression capable of returning a boolean result.
STATEMENT An ARexx statement or command line to be executed.

Interpret STATEMENT/A
This command is used to execute the code in the argument specified. This allows an ARexx script to generate ARexx programs in real time and dynamically. The argument may be any valid ARexx block. A Break will exit the Interpret command.
STATEMENT A valid ARexx block to be executed.

Iterate VARIABLE/A
This statement is used to increment the value of the specified variable from within an iterative Do loop.
VARIABLE Optional variable to be incremented.

Leave VARIABLE/A
This command is used to exit a Do loop under a specified condition. The command requires an iterative loop, with the optional VARIABLE used to specify which loop is to be exited in the event of a nested loop.
VARIABLE Optional variable defined by the given Do loop.

Nop
This command is provided for the sole purpose of doing nothing. The NO-OPERATION command is often used to buffer a list of commands, for example as a conditional execution in an IF-THEN-ELSE clause.

Numeric DIGITS/K FUZZ/K | FORM SCIENTIFIC/S ENGINEERING/S
This is used to set how numbers will be used. the first two switches define the precision, while the latter two define the display format. The display format requires the FORM keyword followed by the format switch.
DIGITS Specifies the precision to be used.
FUZZ Specifies the number of DIGITS to be ignored.
FORM Specifies the type of display format:
SCIENTIFIC Base of 1 to 10 with exponent.
ENGINEERING Base of 1 to 1000 with exponent.

Options FAILAT/K PROMPT/K RESULTS/S
This is used to set some of the settings used in an ARexx program. Typing the command alone with no options reverts it to the predefined settings.
FAILAT Sets which numeric value is to be used when reporting errors.
PROMPT Sets prompt to be displayed while inputting from the console.
RESULTS Notifies the program to wait for a result code when calling external functions.

Otherwise STATEMENT/F
This is used to define an alternate default option within a Select block. This block is required in the event that all tests using the When command fail.
STATEMENT Statement to be executed upon failure of all other statements in the current block.

Parse UPPER/S INPUT/M
This is used to parse a string and return substrings, assigning them to specific variables.
UPPER All data returned in uppercase only.
INPUT An argument used to define the source of input, being one of:
ARG Returns arguments passed to the program or function.
EXTERNAL Inputs a string from the console window.
NUMERIC Returns the settings of numeric display and usage, in the form:
PULL Inputs a string from the console window.
SOURCE Information is returned about the calling function in the following format:
COMMAND RESULT CALLED NAME EXTENSION HOST
COMMAND The name of the calling program or function.
RESULT Boolean declaring whether a result code was requested.
CALLED The name of the program or function called.
NAME Actual name of the program or function called.
EXTENSION File extension used.
HOST Host port specified.
VALUE..WITH Returns the expression delimited by the arguments.
VAR The variable is used as the input string.
VERSION Information is returned about the ARexx interpreter in the following format:
AREXX VERSION CPU FPU VIDEO_MODE CLOCK_RATE
VERSION The version number of the interpreter.
CPU The type of CPU used.
FPU The type of FPU used.
VIDEO_MODE The form of video, NTSC or PAL.
CLOCK_RATE The clock frequency, 50Hz or 60Hz.

Procedure EXPOSE/S VARIABLE/M
This is used within a function to preserve the global symbol table and allow the use of a newly defined table. This table may allow a select number of variables to be modified, as defined with the EXPOSE option.
EXPOSE Designates that the following variables are global.
VARIABLE A variable or stem to be made global. All stems following a variable, but not preceeding, are also made global.

Pull VARIABLE/M
This command will return the arguments received from the console. The number of arguments can be from 1 to 15. The arguments are then returned in all uppercase characters.
VARIABLE The variable name of the given argument.

Return EXPRESSION/A
This is used to return a value from a function.
EXPRESSION A value to be returned from the function.

Say STRING/S
This command may be interchanged with the Echo command. The STRING and values may be written in any sequence, and may appear any number of times. STRING must be delimitted with single or double quotes.
STRING A string to be output.

Select
This loop structure is used to evaluate a given set of conditions using When statements. The block may contain any number of When statements, an Otherwise statement, and is delimited by an End statement.

Shell STRING/M VALUE/K
This is used to access an external program from the ARexx script. With no arguments, this toggles between the currently accessed external program and the previous external program. This is the same as the Address command.
STRING Specifies a new external program as the host program. With an optional command, may be used to pass an argument to the host.
VALUE This defines an expression to set the new external host program.

Signal ON/S OFF/S TYPE/A
This command is capable of sending a signal to an ARexx interruptable program.
ON Turns signal ON.
OFF Turns signal OFF.
The types are as follows:
BREAK_C This is an AmigaDOS compatible CTRL-C event trap, used to provide an alternate sequence of events in the event the user sends the sequence to the program. If disabled, the ARexx script will halt.
BREAK_D This is an AmigaDOS compatible CTRL-D event trap, used to provide an alternate sequence of events in the event the user sends the sequence to the program. If disabled, the ARexx script will ignore this event.
BREAK_E This is an AmigaDOS compatible CTRL-E event trap, used to provide an alternate sequence of events in the event the user sends the sequence to the program. If disabled, the ARexx script will ignore this event.
BREAK_F This is an AmigaDOS compatible CTRL-F event trap, used to provide an alternate sequence of events in the event the user sends the sequence to the program. If disabled, the ARexx script will ignore this event.
ERROR This interrupt traps all return codes that are errors.
HALT This allows trapping of external HALT commands, although if disabled the ARexx script will halt.
IOERR This will trap errors through the input and output devices.
NOVALUE This will trap variables that are not initialized.
SYNTAX This will trap any Syntax errors that occur during the execution of the ARexx script.

When EXPRESSION/A Then STATEMENT/A
This command is used to test a condition during a SELECT block.
EXPRESSION A boolean expression.
STATEMENT An ARexx executable statement.