Product SiteDocumentation Site

1.13.6. Environment Symbols

An environment symbol starts with a period and has at least one other character. The symbol may not be a valid Rexx number. By default the value of an environment symbol is the string consisting of the characters of the symbol (translated to uppercase). If the symbol identifies an object in the current environment, its value is the mapped object.
These are environment symbols:

Example 1.33. Environment symbols

.method    // A reference to the Rexx Method class

.true      // The Rexx "true" object.  Has the value "1"

.xyz       // Normally the value .XYZ

.3DGlasses // Normally the value .3DGLASSES

When you use an environment symbol, the language processor performs a series of searches to see if the environment symbol has an assigned value. The search locations and their ordering are:
  1. The directory of classes declared on ::CLASS directives (see Section 3.2, “::CLASS”) within the current program package or added to the current package using the addClass() method (Section 5.1.6.3, “addClass”.
  2. The directory of PUBLIC classes declared on ::CLASS directives of other files included with a ::REQUIRES directive or added to the current Package instance using the addPackage() method (Section 5.1.6.3, “addClass”).
  3. The local environment directory specific to the current interpreter instance. 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. (See Section 6.2, “The Local Directory (.LOCAL)”.)
  4. 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 (see Section 6.1, “The Environment Directory (.ENVIRONMENT)”). Entries in the global environment directory can also be accessed via the VALUE built-in function (see Section 7.4.71, “VALUE”) by using a null string for the selector argument.
  5. Rexx defined symbols. Other simple environment symbols are reserved for use by Rexx built-in environment objects (Chapter 6, Rexx Runtime Objects). The currently defined built-in objects are .RS, .LINE, .METHODS, .ROUTINES, and .CONTEXT.
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 the .ENVIRONMENT directories for programs to use. To avoid conflicts with future Rexx defined entries, it is recommended that the entries that you place in either directory include at least one period in the entry name.
Example:
/* establish settings directory */
.local~setentry("MyProgram.settings", .directory~new)