| Tutorial | Classes | Functions | QSA Developer | Language | Library | Qt API Qt Script for Applications

[Prev: while] [Home] [Next: Built-in Exceptions]

with

with ( QualifyingName ) {
    Statements;
}

This keyword is used to indicate that any unqualified names in the Statements should be qualified by QualifyingName.

Example:

// Without with
    System.print "one ";
    System.print "two ";
    System.println "three";
// With with
    with ( System ) {
        print "one ";
        print "two ";
        println "three";
    }

If multiple qualifying names are required, with statements can be nested, e.g.

    with ( System ) {
        with ( Math ) {
            print abs( -4 );
            print pow( 2, 3 );
            print random();
        }
    }

Forcing the interpreter to do the lookup may be slower than using the fully qualified names.

[Prev: while] [Home] [Next: Built-in Exceptions]


Copyright © 2001-2002 TrolltechTrademarks
QSA version 1.0.0-beta1