Re: Try Finally...

From: VBDis (
Date: 10/26/04

Date: 26 Oct 2004 21:27:45 GMT

Im Artikel <>, L D Blake
<not@any.adr> schreibt:

>Ok... lemme give you a tiny suggestion... Instead of arguing against you know
>not what; try asking questions until you understand. You will find that I
>(and people in general) respond much more favorably to inquiry than errant

Point taken. So please explain what's wrong with this code:

  assert(False, 'test exception');
  WriteLn('don't want to handle exceptions');

as opposed to

  assert(False, 'test exception');
  WriteLn('don't want to abort on exceptions');

Okay, after an test with D4 I understand your complaint that without the
inclusion of SysUtils the first version aborts immediately, without executing
the Finally code. But since the code takes no means to prevent an abort at all,
this seems to be the shortest way to do exactly what the code means: abort on
any exception. Short also in code size, 23KB less due to not including

But as soon as any unit in the project uses SysUtils, the Finally part
executes, and also the debugger stops the program when the exception is raised.

More annyoing, and really unexpected to any Delphi user, is the behaviour of
Except, when SysUtils is not used anywhere in the project. Then also Except
does not prevent the program from being terminated immedately, when an
exception occurs! Thanks for demonstrating that :-)

So let me rephrase your complaint about Delphi SEH. It should not read:
  Finally causes a program to abort.
Instead it should read:
  Except does not prevent a program from aborting, if SysUtils is not used.