Hiya, does delphi have any of doing something like Dimi suggests below?

---------- Forwarded message ----------
Date: Sun, 28 May 2000 11:53:56 -0400
From: Dimitrie O. Paun <[EMAIL PROTECTED]>
To: Mark Derricutt <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: Error Messages
Resent-Date: Sun, 28 May 2000 13:35:47 -0400
Resent-From: [EMAIL PROTECTED]

On Sun, 28 May 2000, Mark Derricutt wrote:

> $ grep -n DebugFmt Main.PAS
> 545:  DebugFmt('main.pas:542: starting steamfield manager (%s)',

This is wrong! You should use some magic constants that the compiler
replaces with the real file name and line number. In C, this would go
something like this (toy example):

#define DEBUG(str) fprintf(stderr, "%s:%d: %s", __FILE__, __LINE__, str)

and you would use the macro in your code as:

  DEBUG("starting steamfield manager");

--
Dimi.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to