Quick start manual

7-34
Delphi Language Guide
where each statementList is a sequence of statements delimited by semicolons. The
try...finally statement executes the statements in statementList
1
(the try clause). If
statementList
1
finishes without raising exceptions, statementList
2
(the finally clause) is
executed. If an exception is raised during execution of statementList
1
, control is
transferred to statementList
2
; once statementList
2
finishes executing, the exception is
re-raised. If a call to the Exit, Break, or Continue procedure causes control to leave
statementList
1
, statementList
2
is automatically executed. Thus the finally clause is
always executed, regardless of how the try clause terminates.
If an exception is raised but not handled in the finally clause, that exception is
propagated out of the try...finally statement, and any exception already raised in the
try clause is lost. The finally clause should therefore handle all locally raised
exceptions, so as not to disturb propagation of other exceptions.
Standard exception classes and routines
The SysUtils and System units declare several standard routines for handling
exceptions, including ExceptObject, ExceptAddr, and ShowException. SysUtils, System
and other units also include dozens of exception classes, all of which (aside from
OutlineError) derive from Exception.
The Exception class has properties called Message and HelpContext that can be used to
pass an error description and a context ID for context-sensitive online
documentation. It also defines various constructor methods that allow you to specify
the description and context ID in different ways. See the online Help for details.