The Default Search Order for Environment Objects
When you use an environment symbol, REXX performs a series of searches to
see if the environment symbol has an assigned value. The search locations
and their ordering are:
- The directory of classes declared on ::CLASS
directives within the current program file.
- The directory of PUBLIC classes declared on ::CLASS
directives of other files included with a ::REQUIRES directive.
- The program local environment directory. The
local environment includes process-specific objects such as the .INPUT and
.OUTPUT objects. You can directly access the local environment directory
by using the .Local environment symbol.
- The global environment directory. The global
environment includes all "permanent" REXX objects such as the REXX supplied
classes (.ARRAY and so on) and constants such as .TRUE and .FALSE. You can
directly access the global environment by using the .environment environment
symbol or using the VALUE built-in function with a null string for the selector
argument.
- REXX defined symbols. Other simple environment
symbols are reserved for use by REXX for built-in objects. The currently
defined built-in objects are .RS and .METHODS.
If an entry is not found for an environment symbol, then the default character
string value is used.
Note: You can place entries in both the .local and .environment
directories for programs to use. To avoid conflicts with future REXX defined
entries, it is recommended that entries you place in either of these directories
include at least one period in the entry name.
Example:
/* establish a global settings directory */.local~setentry('MyProgram.settings', .directory~new)
[Back: Built-In Environment Objects]
[Next: Determining the "Scope" of Methods and Variables]