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

[Prev: case] [Home] [Next: continue]

catch

try {
    Statements;
}
catch( exception ) {
    ExceptionStatements;
}

This keyword is used in try statements. If an exception occurs, then the ExceptionStatements in a matching catch block are executed.

Catch blocks come in two varieties, unqualified and qualified. An unqualified catch block has the form:

    catch ( e ) {
        /* statements */
    }

and a qualified catch block has the form:

    catch ( e if e instanceOf RangeError ) {
        /* statements */
    }

The possible exception types are:

See try for an example.

[Prev: case] [Home] [Next: continue]


Copyright © 2001-2006 TrolltechTrademarks
QSA version 1.1.5