Software Archive
Read-only legacy content
17061 Discussions

need an ASSERT like macro

rahzan
New Contributor I
636 Views
Is there a way to check on whether the code is running in debug mode ? (similar to the ASSERT macro in MSc.

Tim
0 Kudos
3 Replies
Steven_L_Intel1
Employee
636 Views
Not that I know of. What I do is define a DEBUG preprocessor symbol in my Debug configuration and then use !DEC$ IF DEFINED (DEBUG) to test for it and display a message.

Steve
0 Kudos
rahzan
New Contributor I
636 Views
I figured as much, except if one forgets to reset the symbol back when going to release things an get yucky.

Thanks anyway.
Tim
0 Kudos
Steven_L_Intel1
Employee
636 Views
No need to reset it. Just make sure that "Win32 Debug" is showing in the Settings window, and your definition will apply to that configuration only.

Steve
0 Kudos
Reply