[fpc-pascal] Finally, exceptions and so on.

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu May 14 12:08:42 CEST 2015


Starting off with this fragment

begin // Start of procedure/function
   try
     ...
     if something then
       exit;
     ...
   finally
     ...
   end
end;

My understanding is that exit "magically" transfers control into the 
finally block before exiting the procedure. However to state the 
obvious, in this fragment

begin // Start of procedure/function
   try
     ...
     if something then
       exit;
     ...
   except
     ...
   end
end;

control doesn't go via the except block.

Is there a single place in the documentation where this sort of 
behaviour is described and prioritised, taking into account interfaces etc.?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list