[fpc-pascal] Finally, exceptions and so on.
Ewald
ewald at yellowcouch.org
Thu May 14 16:47:44 CEST 2015
On 05/14/2015 04:17 PM, Mark Morgan Lloyd wrote:
>
> So in effect, both an exit and a raise first execute the innermost
> finally, then look for procedure end or exception block repeating as
> necessary.
Yes.
> These are the only cases where syntax needs to be unwound in this way.
>
Well... There is also continue and break. The following program will
also execute the Finally statements before exiting the loop:
==== Code Begin ====
Program TestFinally;
{$mode ObjFPC}
Procedure Whatever;
Begin
WriteLn('Finally.');
End;
Begin
While True do
Try
Break
Finally
Whatever
End;
Repeat
Try
Continue
Finally
Whatever
End
Until True;
End.
==== Code End ====
--
Ewald
More information about the fpc-pascal
mailing list