next up previous contents index search.gif
Next: 10.5 Exception classes Up: 10. Exceptions Previous: 10.3 The try...finally statement

10.4 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.

root
1999-06-10