The Env package provides a small set of services for reading and manipulating system environment variables.
Integer LC_ALL
All locale-specific behavior (all categories).
LC_COLLATEInteger LC_COLLATE
Behavior of strcoll and strxfrm functions.
LC_CTYPE
Integer LC_CTYPE
Behavior of character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected).
LC_MONETARY
Integer LC_MONETARY
Monetary formatting information returned by the localeconv function.
LC_NUMERICInteger LC_NUMERIC
Decimal-point character for formatted output routines (for example, printf), data conversion routines, and nonmonetary formatting information returned by localeconv function.
LC_TIMEInteger LC_TIME
Behavior of strftime function.
LC_MESSAGESInteger LC_MESSAGES
(Unix only) Behavior of messaging functions such as dgettext, gettext, and gettxt.
GetString Get( String environmentVariableName )
Returns the value of the specified environment variable.
environmentVariableName | - | An environment variable name. |
String GetDefault( String environmentVariableName, String defaultValue )
Returns the value of the specified environment variable if it exists; otherwise, it returns the specified default value.
environmentVariableName | - | An environment variable name. |
defaultValue | - | A default value. |
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". |
if ( Env.Put( "OTHOME=/usr/local/livelink" ) ) Echo( "Put() success!" ) else Echo( "Put() failure." ) end
String SetLocale( Integer lcConstant , String lcString )
Internal use only. Tests string behavior for other language locales.
lcConstant | - | One of the category constants in LC_XXX. |
lcString | - | A valid locale string. |
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.
translationString | - | A String to translate. |
Here is an example:
Echo( Env.Translate( "OTHOME=$OTHOME, and PATH=$PATH" ) )