Re: Try Finally...
From: L D Blake (not_at_any.adr)
Date: 10/25/04
- Next message: Maarten Wiltink: "Re: Try Finally..."
- Previous message: Marco van de Voort: "Re: Try Finally..."
- In reply to: Duncan McNiven: "Re: Try Finally..."
- Next in thread: Duncan McNiven: "Re: Try Finally..."
- Reply:(deleted message) Duncan McNiven: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 25 Oct 2004 08:23:21 -0400
On Mon, 25 Oct 2004 11:23:03 +0100, Duncan McNiven <duncan@mcniven.net> wrote:
>On Mon, 25 Oct 2004 04:37:22 -0400, L D Blake <not@any.adr> wrote:
>
>>The problem is that **when invoked by an exception** the current Delphi
>>implementation of "Finally" *always* terminates the program... there is no
>>carrying on.
>
>I think I am missing your point completely. My understanding is that
>Finally NEVER terminates the program, and it is ALWAYS possible to carry
>on. For example:
Program test;
var
x,y : longint;
procedure doit(z:longint);
begin
try
y := 100;
x := y div z;
finally
writeln('in the finally block now');
end;
end;
begin
doit(0);
writeln('if you''re right you will see this');
end;
The program will terminate in the finally block and you will never see the
final writeln "if you're right you will see this');
There are two conditions under which finally is entered...
1) Normally... the code is executed and the program continues.
2) Exception... the code is executed and the program terminates.
-----
Laura
http://www.start.ca/users/ldblake
- Next message: Maarten Wiltink: "Re: Try Finally..."
- Previous message: Marco van de Voort: "Re: Try Finally..."
- In reply to: Duncan McNiven: "Re: Try Finally..."
- Next in thread: Duncan McNiven: "Re: Try Finally..."
- Reply:(deleted message) Duncan McNiven: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|