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:

  1. The classes and routines maintained in the current package by the interpreter. This package can be retrieved programmatically with the statement .context~package.
  2. "" The current package local directory. The package local directory can be accessed programmatically with the statement .context~package~local.
  3. The program local environment directory .local, which includes interpreter instance-specific objects such as the .input and .output objects. You can directly access the local environment directory by using the .local environment symbol.
  4. The global environment directory .environment, which includes all "global" Rexx objects such as the Rexx-supplied classes (for example, .Array) and constants such as .true and .false. You can directly access the global environment by using the .environment symbol or using the VALUE built-in function with a null string for the selector argument.
  5. Rexx defined symbols. Other simple environment symbols are reserved for use by Rexx for built-in objects.

If an entry is not found for an environment symbol, the default character string value (uppercased) of the environment symbol is used including its leading dot.

Note

You can place entries in the .context~package~local, .local and .environment directories for programs to use, but .local should be preferred over .environment to avoid accidentally overwriting system-defined values. 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.


.Local Object
/* establish a settings directory in the local environment directory*/
.local~setentry("my.settings", .directory~new)