next up previous contents
Next: Edit Descriptors Up: More Input and Output Previous: WRITE Statement

 

FORMAT Statement / FMT= Specifier

FMT= can specify either a line number of a FORMAT statement, an actual format string or a *.

Fortran 90 has a rich formatting syntax, only the highlights are given here.

An example,

    WRITE(17,FMT=&
     '(2X,2I4,1X,''name '',A7)')i,j,str
    READ(14,*) x,y
    WRITE(*,FMT=10) a,b
 10 FORMAT('vals',2(F15.6,2X))

The data is formatted using edit descriptors.

The following is written,

    11-195 name Philip 
vals      -1.051330    333356.000033

For more information, click here gif


next up previous contents
Next: Edit Descriptors Up: More Input and Output Previous: WRITE Statement

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.