Tremorblue
Programmer
I wanted to create a debug version of my application.
How can I create a macro that is compiled in only when I create the debug version. I would like to pass messages to a memo when in debug mode, but dont want any residual code when not in use.
Heres what I have so far...
#define DEBUG
#ifdef DEBUG
void __fastcall TForm1:ebugMessage(AnsiString aMessage)
{
Memo1->Lines->Add(aMessage);
}
#else
void __fastcall TForm1:ebugMessage(AnsiString aMessage)
{
}
#endif
#define DBG(a) Form1->DebugMessage((AnsiString)a);
Trouble is when its not in use debugmessage still gets called
/TB
How can I create a macro that is compiled in only when I create the debug version. I would like to pass messages to a memo when in debug mode, but dont want any residual code when not in use.
Heres what I have so far...
#define DEBUG
#ifdef DEBUG
void __fastcall TForm1:ebugMessage(AnsiString aMessage)
{
Memo1->Lines->Add(aMessage);
}
#else
void __fastcall TForm1:ebugMessage(AnsiString aMessage)
{
}
#endif
#define DBG(a) Form1->DebugMessage((AnsiString)a);
Trouble is when its not in use debugmessage still gets called
/TB