[lazarus] Better proposition for debug code.
michael at tfdec1.fys.kuleuven.ac.be
michael at tfdec1.fys.kuleuven.ac.be
Wed Jul 21 09:04:27 EDT 1999
On Wed, 21 Jul 1999, Michael A. Hess wrote:
> Michael Van Canneyt wrote:
> >
> > Hello,
> >
> > May I remind you that the compiler supports the ASSERT() construct of Delphi;
> > that you can specify a
> > AssertErrorProc
> > which takes care of the asserts ?
> >
> > This means that you can have the whole debug class stuff without the
> > juggling with macros.
> >
> > Just do a
> >
> > Assert(False,'Some debug message');
>
> But doesn't the Assert abort the application after it is called? We want
> to use the debug as a tracing feature to give us processing out of the
> code as it runs. This would print the Assert line and stop. Or am I
> misunderstanding how Assert is used in FPC?
This is the default behaviour; if you set the procedural variable
'asserterrorproc' then you can customize the behaviour; the application just
continues after the assertion handler.
careful; the systutils unit sets the handler, and turns it into an
exception. you must be sure that sysutils doesn't override your handler.
(normally, it should not)
Michael.
More information about the Lazarus
mailing list