[lazarus] Win32 Installer/Lazarus

Michael A. Hess mhess at miraclec.com
Tue Jul 20 16:21:29 EDT 1999


Stefan Hille wrote:
> 
> 1. Let's live with the extra code and put the ifdef's only in the
> debug-class. This would give some extra code, but the cost would only
> be an extra call with a direct return. When thinking of performance
> this approach should be OK.

This is what the TDebug class does already without the need of IFDefs.
The switch that sets debug on or off is just a flag that tells the
TDebug.Write to do a direct return and not do anything. The ifdef
wouldn't buy you anything.

> 2. Use the macro feature of fpc

NOW THIS IDEA I LIKE!

Here is what we could do.

{$define DEBUGOUT:=debug.write}

Then anyplace in the code put code

DEBUGOUT ('whatever trace information you want');

Then when you don't want debug you just need to redefine the macro to be

{$define DEBUGOUT:=//}

The the code becomes

// ('whatever trace information you want');

What does everyone think about this???

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