Function ExTest() Throw "Bingo!" End Function Try ExTest() Catch ex:Object Print ex.ToString() End TryThrowing an exception causes the program to jump to nearest Catch block. You can provide multiple catch blocks for catching exceptions of different types. If there is no Catch block, then the exception is sent to the debugger which usually has the effect of halting the program with an appropriate message.
Exception | Cause |
---|---|
TNullObjectException | Thrown when a program attempts to access a null object |
TNullMethodException | Thrown when a program attempts to call an abstract method |
TNullFunctionException | Thrown when a program attempts to call a null function |
TArrayBoundsException | Thrown when a program attempts to access an array element outside of an array's bounds |
TRuntimeException | Thrown by the RuntimeError or Assert commands |