Env$: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
ENV$(<variable | ENV$(<variable>) | ||
The '''Env$(var$)''' returns the current value of the environment variable | The '''Env$(var$)''' returns the current value of the environment variable. The Env$ function can be used to obtain the value of any user-created or system-created environment variable that can be displayed with the operating system's SET (or set) command. To see a list of these variables, enter the SET command with no parameters at the operating system prompt. | ||
The '''Env$''' function is used to retrieve an [[environmental variable]]'s value which was set with [[SetEnv]] or inherited from Windows' environmental variables. | The '''Env$''' function is used to retrieve an [[environmental variable]]'s value which was set with [[SetEnv]] or inherited from Windows' environmental variables. |
Revision as of 17:16, 22 May 2014
ENV$(<variable>)
The Env$(var$) returns the current value of the environment variable. The Env$ function can be used to obtain the value of any user-created or system-created environment variable that can be displayed with the operating system's SET (or set) command. To see a list of these variables, enter the SET command with no parameters at the operating system prompt.
The Env$ function is used to retrieve an environmental variable's value which was set with SetEnv or inherited from Windows' environmental variables.
Example:
got1$=env$("UserName") got2$=env$("GUIMode")
Additionally the status command showing all set environmental variables is:
Status Env
The Env$ internal function can be set by CONFIG SETENV. For example, use the following command to set the value of env$("librarypath"):
config setenv librarypath f:\apps\library\
Operating system ENV$ variables cannot be set or altered by CONFIG SETENV. Other system Env$ variables will be added.
Comments and Examples
As an example, if LOGNAME contains the login name, the following line in a menu program would require a user to log in as "root" to be able to run program PROG14.
00040 if env$("LogName")="root" then chain "Prog14" else goto SHOWMENU
Technical Considerations
- Unix / Linux versions of Business Rules require that user-created environment variables be passed by an export command to the operating system before the user enters Business Rules . Otherwise, the values of these variables cannot be returned by ENV$.
Env$("GUIMode")
There is a BR provided Env$ variable called GUIMODE (case insensitive). It's value is either ON or OFF depending on whether BR is in GUI mode. System ENV$ variables cannot be set or altered by CONFIG SETENV. Other system Env$ variables will be added.