- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the following code in one of my Fortran Program which is working fine in Unix. where as the same code is giving errors while compiling in windows (intel fortran). How to use such statements in Windows
#ifdef BYPASSBUILTDATE
character *10 BUILTDATE/ BYPASSBUILTDATE /
#else
character*7 BUILTDATE/'No date'/
#endif
#ifdef BYPASSVERSION
character*8 VERSION/ BYPASSVERSION /
#else
character*10 VERSION/'No version'/
Thanks,
Chandra.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Conditionnal compilation syntax is :
!dec$ if defined(VARIABLE_NAME)
...
!dec$ else
...
!dec$ endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the #if syntax but have to enable the "Fortran Preprocessor" option - it is off by default. /fpp from the command line or the Preprocessor property page in Visual Studio.

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