Page 1 of 1

Determine if debugger is attached.

Posted: Wed Sep 08, 2010 10:07 am
by bsweeney
Is there a technique for determine if the debugger is attached? Maybe a compiler variable? I'd like to omit certain sections of script conditionally, only if i'm running the software from the IDE. Could i define my own compiler variable? Is there some other way I could accomplish this?

thanks,
brian

Re: Determine if debugger is attached.

Posted: Wed Sep 08, 2010 9:53 pm
by mills
There isn't quite an equivalent to C++ #if DEBUG.

You could use compiler variables to simulate this pretty closely, though. (requires Studio edition or better)

You can find the compiler variables in the Project Settings->Compile Variables.

You'll probably want to set the default value to TRUE. Just remember to change it accordingly for non-debug testing and release.

Re: Determine if debugger is attached.

Posted: Thu Sep 09, 2010 9:43 am
by bsweeney
I like the sounds of this approach, thanks!