How to do block comment in fortran?

前端 未结 6 1126
-上瘾入骨i
-上瘾入骨i 2021-01-03 21:06

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

相关标签:
6条回答
  • 2021-01-03 21:44

    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. :)

    0 讨论(0)
  • 2021-01-03 21:46

    In Sublime text editor it can be used Toggle Comment (Ctrl+7) or Toggle Block Comment.

    0 讨论(0)
  • 2021-01-03 21:48

    If your FORTRAN compiler supports preprocessor macros then a popular method is to use (What exactly does an #if 0 ..... #endif block do?)

    #if 0
    ...
    Your comments ...
    go here ...
    ...
    #endif
    
    0 讨论(0)
  • 2021-01-03 21:50

    It is much simpler to use a text editor which allows for multiline commenting using "SHIFT + /"!

    0 讨论(0)
  • 2021-01-03 21:52

    A line with a c, C, *, d, D, or ! in column one is a comment line; except that if the -xld option is set, then the lines starting with D or d are compiled as debug lines. The d, D, and ! are nonstandard.

    If you put an exclamation mark (!) in any column of the statement field, except within character literals, then everything after the ! on that line is a comment.

    0 讨论(0)
  • 2021-01-03 21:55

    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.

    0 讨论(0)
提交回复
热议问题