fortrancommentsfortran77

FORTRAN 77 comments starting at column 7


If I understand correctly, any line that starts with C in column 1 is automatically a comment. So why do some code samples I see start the comment text at column 7? Is this just to make all text line up a little nicer, or was it required by some compilers?


Solution

  • Where the text of the comments start is completely irrelevant to the compiler, the compiler just ignores the line or the punch card.

    It is just up to the programmer to format the comments based on the reasons that made him/her to create such comment. Often, programmers will want the comments to be somehow aligned, but it is not necessary.

    For example, if a line of code that contained a numeric label is commented out, it will often start earlier than column 7.