- Procedure EnvironmentGetString(Key, Value)
EnvironmentGetString
With the procedure EnvironmentGetString
you can obtain the string
representation of an environment setting, either set by the process
calling AIMMS or by AIMMS itself.
EnvironmentGetString(
Key, ! (input) scalar string expression
Value ! (output) scalar string parameter
)
Arguments
- Key
A string expression holding the name of the environment variable.
- Value
A scalar string parameter that, on return, contains the string representation of the current value of the environment variable.
Return Value
The procedure returns 1 if the variable
Key
is available, and 0 otherwise.
Note
The environment variables defined by AIMMS itself are:
AIMMSROOT
,AIMMSBIN
,AIMMSSOLVERS
,AIMMSCFG
,AIMMSHELP
,AIMMSDOC
,AIMMSUSERDLL
,AIMMSLOG
,AIMMSPROJECT
,AIMMSMODULES
, andAIMMSTUTORIAL
.Examples of environment variables available on a Windows system are
COMPUTERNAME
,OS
,PATH
,TEMP
,TMP
, andUSERNAME
. Entering the MSDOS commandset
on an MSDOS prompt will present you with the set of available environment variables on a Windows system. Via the control panel toolsystem
and then going toAdvanced system settings
-Advanced
tab -Environment variables
button, you can manipulate the set of environment variables.On Linux systems a distinction is made between the variables kept to a process itself, and those exported to the environment of all its child processes. In a bash shell you can obtain the collection of variables set via the bash
set
command, and the subset of all exported environment variables via the bashenv
command. In order to make a variable available to the environment, you will have to explicitly place it in the environment, via anexport
command. In several system wide bash scripts,/etc/bashrc
, or user startup bash scripts,~/.bashrc
, export commands such as:export HOSTNAME export OSTYPE
can be found in order to make these useful environment variables available to all processes executed.
See also