How Do I Retrieve a Value from the System Environment Settings? (Magic xpa 3.x)
The system environment has a number of useful pieces of information available for you, such as the system user ID, the operating system type and version, the computer name, and the path to the command shell. You can use these within your Magic xpa programs by fetching the environment variable with the function OSEnvGet.
The function OSEnvGet has the syntax:
OSEnvGet(Variable)
Where Variable is the system name of the system environment variable.
In this example we used it with an update operation to store the path to the command shell. Some of the more useful command shell variables are COMSPEC, OS, USERNAME, USERDOMAIN, and LOGONSERVER. However, you can also create your own, and there are likely some useful settings that are local to your environment.
Hint: You can view all your current environment settings by opening a command shell and typing SET at the command prompt.
The Online and Rich Client Samples projects (program EL14, REL14 and REL14b)