Kilowatt Software's
Classic Rexx Tutorial
Language Level 4.00 (TRL-2)

Address instruction

The address instruction alters the destination of commands. The address instruction is also used to deliver a command to a specific environment. The current command environment can be determined by using the address built-in function.

The address instruction has the following syntax variations:


1. address environmentName

This establishes the explicit environmentName as the target for subsequent commands. The prior environment is saved for subsequent toggling by the 3rd form of the address instruction.


2. address [ VALUE ] environmentExpression

This establishes the value of environmentExpression as the target for subsequent commands. The prior environment is saved for subsequent toggling by the 3rd form of the address instruction. A value keyword can optionally be specified, which helps distinguish this form of the address instruction from the 1st and 4th forms. The value keyword can be omitted if environmentExpression does not begin with a symbol or literal string -- i.e. it could start with a parenthesis.


3. address

This toggles the prior and current command environments. The environment that was previously active becomes the current target for commands, while the environment that was current before this instruction becomes the prior environment. Thus, a sequence of address instructions in the 3rd form, will switch between two environments.


4. address environmentName commandExpression

This sends the result of evaluating the commandExpression to the explicit environmentName. This form of the address instruction has no affect on the prior and current command environments.

Note: in a procedure, you can alter the current environment by using the address built-in function, without affecting the environment(s) that have been established by a calling procedure.

Note: the names of target environments is implementation-dependent, as is the method used to launch commands.


Kilowatt Software's -- Classic Rexx Tutorial -- Back to top
Click here if you have any comments or questions regarding this tutorial

Last updated on: 9 Aug 2002