forlang.hlp (Table of Contents; Topic list)
$FREEFORM and $NOFREEFORM
                                             Up Contents Index Back
─────$FREEFORM and $NOFREEFORM──────────────────────────────────────────────
 
     Action
 
     $NOFREEFORM specifies that a source file is in standard FORTRAN
     format; $FREEFORM specifies that a source file is in free-form
     format.
 
     Syntax  $[NO]FREEFORM
 
     Remarks
 
     This metacommand must precede any FORTRAN statements.
 
     $FREEFORM allows source code to use the following format:
 
        ■ A double quotation mark (") in column 1 indicates a comment
          line. An exclamation point outside a character or Hollerith
          constant indicates the beginning of an in-line comment.
 
        ■ Initial lines may start in any column.
 
        ■ The first nonblank character of an initial line may be a
          digit (the first digit in a statement number). The statement
          number may be from one to five decimal digits.
 
        ■ If the last nonblank, noncomment character of a line is a
          minus sign, it is discarded and the next line is taken to
          be a continuation line.
 
        ■ Alphabetic characters and asterisks are not allowed as
          comment markers in column 1.
 
     The $[NO]FREEFORM metacommand is equivalent to the /4{Y | N}f
     compiler option.
 
     Example
 
     $FREEFORM
 
     "The sine of the number x is calculated using a power series.
     "Successive terms are calculated until one is less than epsi.
 
     REAL x, epsi, z, sine, next
     epsi = 0.0001
 
     WRITE  (*, 100)
     100  FORMAT (1X, 'ENTER x: ' \)
     READ   (*, '(F10.5)') x
 
     z    =  AMOD (x, 6.2831853)
     sine =  z
     i    =  4.0
     next = -z * z * z / 6.0
 
     200  IF (ABS (next) .GE. epsi) THEN
     sine =  sine + next
     next = -next * z * z / (i * (i + 1.0))
     i    =  i + 2.0
     GOTO 200
     ENDIF
 
     WRITE  (*, 300) x, sine
     300  FORMAT (1X, 'THE SINE OF ', F10.5, -
              ' = ', F12.10)
     END
                                    -♦-