[Prev: Math] [Home] [Next: Built-in Variables and Constants]

System

The System object always exists in a Qt Script program. Use the System object to access and manipulate environment variables, e.g. with getenv(), setenv() and to print text to the console with print() and println().

System Functions
getenv()

getenv( environmentVariable )

Returns the string stored in the given environmentVariable.

Example:

    var q = System.getenv( "QTDIR" ); // q == /usr/local/qt

See also setenv().

print()

print( expression )

Prints the expression (applying toString() if necessary) to the console (stdout).

println()

print( expression )

Prints the expression (applying toString() if necessary) to the console (stdout), followed by a newline.

See also debug().

setenv()

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 Qt Script for Applications process for the duration of the process.

See also getenv().

[Prev: Math] [Home] [Next: Built-in Variables and Constants]