- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the following stupid question. I am a C++ programmer and have to write a bit of Fortran code.
I am using CFV 6.1A and looking for something like ASSERT of VC++ - i.e. I want to write a condition in the code and if it is not met the debugger should stop the execution at this point so I can walk through the stack watch variables, etc.
I am using CFV 6.1A and looking for something like ASSERT of VC++ - i.e. I want to write a condition in the code and if it is not met the debugger should stop the execution at this point so I can walk through the stack watch variables, etc.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think there is a way to do this, using /define or via the "predefined preprocessor symbols" under, Project, setting, Fortran.
I think you define something which is true only in the DEBUG mode and then condition on it to do other things.
I have done something like this a longtime ago but can't remember exactly how. I do not think that it will be difficult.
Tim
I think you define something which is true only in the DEBUG mode and then condition on it to do other things.
I have done something like this a longtime ago but can't remember exactly how. I do not think that it will be difficult.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok I had to look it up:
put in a name like DEBUG in the text box for the predefined preprocessor variables in the fortran Tab of the project settings.
Make sure this is done ONLY for the Debug config.
Then in the code write
!dec$ if defined (DEBUG)
if(...) !this will now act like ASSERT
... do whatever
!dec$ endif
Tim
put in a name like DEBUG in the text box for the predefined preprocessor variables in the fortran Tab of the project settings.
Make sure this is done ONLY for the Debug config.
Then in the code write
!dec$ if defined (DEBUG)
if(...) !this will now act like ASSERT
... do whatever
!dec$ endif
Tim
![](/skins/images/54BF544B471F3F61DFD338F1D58F9426/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page