Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

comment on many consecutive lines

Mike896
Beginner
2,031 Views

Hi,

I'd like to ask how to set comments on many consecutive lines in IVF?

thanks.

Mike

0 Kudos
1 Solution
Jugoslav_Dujic
Valued Contributor II
2,031 Views
A "quick'n'dirty" method to comment out a huge block of code is to use preprocessor:

!DEC$IF (.FALSE.)
...
!DEC$ENDIF

or, if you're using /fpp switch:

#if 0
...
#endif

However, that is suitable only e.g. if you're doing code bisection (bug tracing by removing huge chunks of code at the moment). I would never leave such "comment" permanently in the code (code coloring does not work in such cases, for the start).

View solution in original post

0 Kudos
2 Replies
DavidWhite
Valued Contributor II
2,031 Views
Quoting - Mike896

Hi,

I'd like to ask how to set comments on many consecutive lines in IVF?

thanks.

Mike

Mike,

All comments in Fortran are line comments only. There is no equivalent of /* ... */ as in C, etc. You need to place ! or C at the beginning of each line to make it a comment.

In visual studio, you can select multiple lines and then use Ctrl-K, ctrl-C to make all lines comments.

Regards,

David

0 Kudos
Jugoslav_Dujic
Valued Contributor II
2,032 Views
A "quick'n'dirty" method to comment out a huge block of code is to use preprocessor:

!DEC$IF (.FALSE.)
...
!DEC$ENDIF

or, if you're using /fpp switch:

#if 0
...
#endif

However, that is suitable only e.g. if you're doing code bisection (bug tracing by removing huge chunks of code at the moment). I would never leave such "comment" permanently in the code (code coloring does not work in such cases, for the start).

0 Kudos
Reply