Previous: Calculator
Up: Pre-installed Classes
Next: EXEC class
Previous Page: Calculator
Next Page: EXEC class

Environment Class

Environment class provides easy access to UNIX environment variables.

Example of Environment Object

DEFINE Etest S 2
      .CHAR16 USER
      .INT4   WINDOWID
END DEFINE -CLASS env -TYPE 0

Etest.USER will always contain the contents of $USER variable and Etest.WINDOWID will return $WINDOWID - if available, or 0 otherwise.

There are three types of env objects:

TYPE=0
The substitution is made every time the object is requested. If the environment variable is not set, corresponding item is set to 0.
TYPE=1
The substitution is made every time the object is requested. If the environment variable is not set then the user is prompted to supply the value on the first access. All subsequent accesses use the value supplied.
TYPE=2
The substitution is made every time the object is requested. If the environment variable is not set then the user is prompted to supply the value.

wwwd@na49
Fri Nov 4 23:36:02 MET 1994