- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have cretaed a test case fortran solution wher ethe main program is including a file name 'preproc.env' where II have defined preprocessor variables as:
!DEC$ ALFA = 1 ! comment
!DEC$ BETA = 1 ! comment
I have noticed the last variable definition (BETA) is ignored by the preprocessor compiler.
No matter how many variables are defined.
Actually I found that if I remove the comment from the last line then it works:
!DEC$ ALFA = 1 ! comment
!DEC$ BETA = 1
Am I violating any rules regarding variable definition ?
I attach a test case solution, it could be a possible issue/error.
Best regards,
Andrea
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use
!DIR$ DEFINE ALPHA = 1
!DIR$ DEFINE BETA = 1
...
!DIR$ IF DEFINED(ALPHA)
...
!DIR$ IF(BETA == 1)
...
!DIR$ ENDIF
...
!DIR$ ENDIF
!DEC$ should be interchangeable with !DIR$.
Try inserting the DEFINE keyword in your !DEC$ defines.
see: IF Directive Construct (intel.com)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Jim,
thank you for your answer, I will exploit your workarund.
However I am highlighting the issue, because I think this is an error.
It seems strange to me that the same code lines change the result, with or without a comment at the end of the last line of the file 'preproc.env'.
Andrea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well maybe it didn't work, maybe alpha was defined as 1 elsewhere? Try !DEC$ ALFA = 2 ! comment and then see if alpha is still 1 where you check it before.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page