Re: Evaluating Exceptions, Try Except and Try Finally

From: Skybuck Flying (nospam_at_hotmail.com)
Date: 04/08/04


Date: Thu, 8 Apr 2004 19:23:13 +0200


"Bruce Roberts" <ber@bounceitattcanada.xnet> wrote in message
news:xRddc.35242$wq4.1798603@news20.bellglobal.com...
>
> "Skybuck Flying" <nospam@hotmail.com> wrote in message
> news:c53at9$vt4$1@news4.tilbu1.nb.home.nl...
>
> > So now I can go change all my code everywhere... so it says:
> >
> > try
> >
> > Connection.Open;
> >
> > finally
> >
> > Connection.Close;
> >
> > end;
>
> Then you will only prove your stupidity. As others have mentioned several
> times the above structure is NOT the way to code things. When using try
> finally to protect resources the format is
>
> allocate the resource
> try
> work with the resource
> finally
> release the resource
> end

That's because I did not understand that finally is ONLY !!!!!!!! executed
when TRY is ENTERED !!!!

THE DOCUMENTATION CLEARLY SAYS:

FINALLY IS ALWAYS EXECUTED
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

IT DID NOT SAY:

FINALLY IS NOT EXECUTED IF AN EXCEPTION OCCURED OUTSIDE THE TRY FINALLY
BLOCK !

STUPID SHITTY EXCEPTIONS ! =D

Skybuck.