I have seen /* block comment */
for block commenting in C++. I know I can do line commenting by using !
or c
, but is there any option for block commenting in Fortran?
In Fortran 90 free source form means you are free to type comments and commands wherever you want. An exclamation point, ! (also known as a "bang"), is used to indicate a comment statement. The comment statement follows the bang and continues to the end of the line.
Everything from the // to the end of the line is a comment. To mark an entire region as a comment, use /* to start the comment and */ to end the comment. * This is a block comment. * This code does nothing.
A line that begins with the letter "c" or an asterisk in the first column is a comment. Comments may appear anywhere in the program. Well-written comments are crucial to program readability. Commercial Fortran codes often contain about 50% comments.
No, the strange concept of block comments is alien to Fortran. Your editor or development environment might provide a way to comment a block of lines in one go.
You can do a little hack though:
go to 100 ! CHUNK OF CODE YOU WANT TO COMMENT OUT 100 continue
Yeah, I know it's horrible but it works. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With