FORTRAN 77 Language Reference

Comments and Blank Lines

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. @

A totally blank line is a comment line.

Example: c, C, d, D, *,!, and blank comments:


c      Start expression analyzer 
       CHARACTER S, STACK*80 
       COMMON /PRMS/ N, S, STACK 
       ... 
*      Crack the expression:
       IF ( S .GE. '0' .AND. S .LE. '9' ) THEN ! EoL comment 
              CALL PUSH        ! Save on stack. EoL comment 
d             PRINT *, S       ! Debug comment & EoL comment 
       ELSE 
              CALL TOLOWER ! To lowercase EoL comment 
       END IF 
D      PRINT *, N!       Debug comment & EoL comment 
       ... 
C      Finished 
!       expression analyzer