next up previous contents index
Next: Exception classes Up: Exceptions Previous: The try...finally statement

Exception handling nesting

It is possible to nest Try...Except blocks with Try...Finally blocks. Program flow will be done according to a lifo (last in, first out) principle: The code of the last encountered Try...Except or Try...Finally block will be executed first. If the exception is not caught, or it was a finally statement, program flow will we transferred to the last but-one block, ad infinitum.

If an exception occurs, and there is no exception handler present, then a runerror 217 will be generated. If you use the sysutils unit, a default handler is installed which ioll show the exception object message, and the address where the exception occurred, after which the program will exit with a Halt instruction.


next up previous contents index
Next: Exception classes Up: Exceptions Previous: The try...finally statement

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998