Env$

From BR Wiki
Revision as of 15:02, 13 January 2012 by Mikhail.zheleznov (talk | contribs) (edit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Env$ internal function returns the current value of the DOS or Unix / Linux environment variable A$. 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$ internal function is used to retrieve an environmental variable's value which was set with SetEnv or inherited from window's environmental variables.

i.e.

  got1$=env$("UserName")
  got2$=env$("GUIMode")

Additionally the status command showing all set environmental variables is:

Status Env

The Env$ internal function cannot be set or altered by CONFIG SETENV.


Env$(A$)


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

1.) 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.