|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles | Qt Script for Applications |

[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()` and `setenv()`, and to print text to the console with `print()` and `println()`.

##### System Functions

- getenv( environmentVariable : String ) : String; Returns the string stored in the given `environmentVariable`.

  Example:

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

- print( expression : String ); Prints the `expression` (applying `toString()` if necessary) to the console (`stdout`).

- println( expression : String ); Prints the `expression` (applying `toString()` if necessary) to the console (`stdout`), followed by a newline.

- setenv( environmentVariable : String, value : String ); 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 process for the duration of the process.

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