[Prev: Qt] [Home] [Next: Built-in Variables and Constants]
The System object always exists in a program. Use the System object to access and manipulate environment variables, e.g. with getenv(), setenv() and unsetenv(), and to print text to the console with print() and println().
getenv( environmentVariable )
Returns the string stored in the given environmentVariable.
Example:
var q = System.getenv( "QTDIR" ); // q == /usr/local/qt
See also setenv() and unsetenv().
print( expression )
Prints the expression (applying toString() if necessary) to the console (stdout).
print( expression )
Prints the expression (applying toString() if necessary) to the console (stdout), followed by a newline.
See also debug().
setenv( environmentVariable, value )
Sets the environmentVariable to the value. If the environmentVariable does not exist it is created. The environment is only changed within the context of the process for the duration of the process.
See also getenv() and unsetenv().
unsetenv( environmentVariable )
Removes the environmentVariable from the process's environment. The environment is only changed within the context of the process for the duration of the process.