The Env package provides a small set of services for reading and manipulating system environment variables.


Class Attributes Index

 o LC_ALL
All locale-specific behavior (all categories).
 o LC_COLLATE
Behavior of strcoll and strxfrm functions.
 o LC_CTYPE
Behavior of character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected).
 o LC_MONETARY
Monetary formatting information returned by the localeconv function.
 o LC_NUMERIC
Decimal-point character for formatted output routines (for example, printf), data conversion routines, and nonmonetary formatting information returned by localeconv function.
 o LC_TIME
Behavior of strftime function.
 o LC_MESSAGES
(Unix only) Behavior of messaging functions such as dgettext, gettext, and gettxt.

Class Methods Index

 o Get( String environmentVariableName )
Returns the value of the specified environment variable.
 o GetDefault( String environmentVariableName, String defaultValue )
Returns the value of the specified environment variable if it exists; otherwise, it returns the specified default value.
 o Put( String nameValue )
(UNIX only) Returns a Boolean indicating success in setting the specified environment variable.
 o SetLocale( Integer lcConstant, String lcString )
Internal use only. Tests string behavior for other language locales.
 o Translate( String translationString )
Returns the specified String, substituting environment variable values for "$"-prefixed names where indicated.

Class Attributes

 o LC_ALL
 Integer LC_ALL

All locale-specific behavior (all categories).

 o LC_COLLATE
 Integer LC_COLLATE

Behavior of strcoll and strxfrm functions.

 o LC_CTYPE
 Integer LC_CTYPE

Behavior of character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected).

 o LC_MONETARY
 Integer LC_MONETARY

Monetary formatting information returned by the localeconv function.

 o LC_NUMERIC
 Integer LC_NUMERIC

Decimal-point character for formatted output routines (for example, printf), data conversion routines, and nonmonetary formatting information returned by localeconv function.

 o LC_TIME
 Integer LC_TIME

Behavior of strftime function.

 o LC_MESSAGES
 Integer LC_MESSAGES

(Unix only) Behavior of messaging functions such as dgettext, gettext, and gettxt.

Class Methods

 o Get
 String Get(
          String environmentVariableName )

Returns the value of the specified environment variable.

Parameters:
environmentVariableName  -  An environment variable name.
Returns:
The value of the specified environment variable.
 o GetDefault
 String GetDefault(
              String environmentVariableName,
              String defaultValue )

Returns the value of the specified environment variable if it exists; otherwise, it returns the specified default value.

Parameters:
environmentVariableName  -  An environment variable name.
defaultValue  -  A default value.
Returns:
The specified environment variable if it exists; otherwise, the specified default value.
 o Put
 Boolean Put(
           String nameValue )

(UNIX only) Returns a Boolean indicating success in setting the specified environment variable. The nameValue argument has the format "environmentVariableName=value".

Parameters:

nameValue  -  A String of the format "environmentVariableName=value".
Returns:
Boolean indicating success in setting the specified environment variable.
For example, to set the "OTHOME" environment variable to "/usr/local/livelink", invoke Put() in the following manner:
if ( Env.Put( "OTHOME=/usr/local/livelink" ) )

	Echo( "Put() success!" )
else
	Echo( "Put() failure." )
end
 o SetLocale
 String SetLocale(
             Integer lcConstant ,
             String lcString )

Internal use only. Tests string behavior for other language locales.

Parameters:
lcConstant  -  One of the category constants in LC_XXX.
lcString  -  A valid locale string.
Returns:
The string.
 o Translate
 String Translate(
             String translationString )

Returns an evaluated translationString, substituting "$"-prefixed environment variable name(s) with corresponding environment variable value(s). Translate() resolves the environment variables in translationString as a typical UNIX shell would.

Parameters:
translationString  -  A String to translate.
Returns:
The specified String with environment variable values substituted where indicated.

Here is an example:

Echo( Env.Translate( "OTHOME=$OTHOME, and PATH=$PATH" ) )