[lazarus] Better proposition for debug code.

michael at tfdec1.fys.kuleuven.ac.be michael at tfdec1.fys.kuleuven.ac.be
Wed Jul 21 09:19:50 EDT 1999




On Wed, 21 Jul 1999 michael at tfdec1.fys.kuleuven.ac.be wrote:

> 
> 
> 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.

Correction: The default behaviour is to print the error on StdErr, and then
to continue the program.

The sysutils unit does make it an exception.

Michael.






More information about the Lazarus mailing list