10-21-2010 04:55 PM
I have a timer based program that gets all cranky when I try to debug. i was looking for a global variable so in my code I could do the following:
#ifndef DEBUG_MODE
elapsed_time = difftime(....)
#else
elapsed_time++;
#endif
Is this possible in CVI based on the config type so I don't have to recomment a line of code each time?
Thanks
10-21-2010 06:36 PM
The macro _CVI_DEBUG_ is defined and has the value of 1 if you're running a debug build of an application.
10-21-2010 06:41 PM
There's a function too,
BeingDebuggedByCVI ( )
returns 1 if true, 0 otherwise.
So if you want compile time selective compile of code when doing a debug build, you can use the macro.
If you want the code to determine at runtime if it's being debugged, use the function.