Re: #iidef and #define to debug program



FBM wrote:
Hi,

I am preparing project for submission and i'd like to allow the print
out of debug messages. I know that with something like

#define DEBUG

#ifdef DEBUG
print(X);
#endif

you can print out comments in an effective way.. however, can these
#define be sent through the command line, in form of a paramterer?


Erm, no. Preprocessin directives are a *compile* time thing.
You could, of course, pass an argument that indicates whether or not you're debugging -- but that would have to be dealt with within the code the compiler actually sees,

[snip]

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com
"You can't KISS* unless you MISS**"
[*-Keep it simple, stupid. **-Make it simple, stupid.]
.



Relevant Pages

  • Re: Debug Vs Release
    ... > If I compile that code in debug mode then dissassemble the EXE, ... > private static void Main(stringargs) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Getting a stack trace from a running application
    ... Unfortunately, the only infromation they can provide is a memory address, which is pretty useless as it doesn't tell me if my main exe is the culprit or if it's some dll or ocx or whatever. ... If you compile the the program with debug information, the debugger will show the responsible line of your code that caused the error. ...
    (comp.lang.basic.visual.misc)
  • Re: copymemory basic question
    ... I have used that technique before; that is, put a MessageBox in a VC program ... workspace and then debug the program without using the MessageBox or MsgBox. ... > - Compile and save. ... not able to show anything due to the optimization. ...
    (microsoft.public.vb.winapi)
  • Re: MustInherit in Window forms
    ... #If Debug then ... Public MustInherit BaseClass ... compile in Release mode. ... the Base form to implement DisconnectFromAbrServer. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MustInherit in Window forms
    ... > #If Debug then ... > Public MustInherit BaseClass ... > compile in Release mode. ... > the Base form to implement DisconnectFromAbrServer. ...
    (microsoft.public.dotnet.languages.vb)