Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

need an ASSERT like macro

rahzan
New Contributor I
655 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
655 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
655 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
655 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