[lazarus] Trace routines using Assert doesn't work

Michael A. Hess mhess at miraclec.com
Tue Jul 27 08:38:45 EDT 1999


Peter Vreman wrote:
> 
> >What could be preventing me from adding any writeln code to the
> >handler?
> >
> >Any clues compiler guys??
> No, because i don't have code which shows the bugs.

I didn't send you any code because the simple code version I created
works fine. It is only in the lcl code that it blows out. I was hoping
that maybe I was doing something stupid and you would be able to say,
"well you did do such and such didn't you". However, with further
testing it seems to be more involved then that. The exceptions isn't
coming from the Assert routines at all. The exception is coming from the
very next method call after the Assert line in my code. It happens to be 

   inherited Create(Owner);

So the code looks like this

begin
   Assert(False, 'Trace:the message');

   inherited Create(Owner);

   Assert(False, 'Trace:next trace message');
.
.
.
.
end;

If I put a try..except around this it fails but ONLY if Assertions are
turned on. I'll work on checking exactly what exception is being thrown
and try to track down who is throwing it.

The weird thing is that if I put a writeln between the Assert and the
inherited line like this

   Assert(False, 'Trace:the message');

writeln('back from Assert');

   inherited Create(Owner);

Then the code DOESN'T throw an exception in the inherited call. But it
will throw and exception on the line following the NEXT Assert line.

I hate it when writeln's fix bugs.   :-\

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list