next up previous contents
Next: Other I/O Statements Up: Input / Output Previous: FORMAT Statement / FMT=

 

Edit Descriptors

Fortran contains a large number of output edit descriptors which means that very complex I/O patterns can be specified, it is only intended that a summary be presented here. Any good textbook will elaborate:

tabular19716

Where,

and,

Descriptors or groups of descriptors can be repeated by prefixing or parenthesesing and prefixing with the number of repeats, for example, I4 can be repeated twice by specifying 2I4 and I4,1X can be repeated twice by specifying 2(I4,1X).

Many of the above edit descriptors can be demonstrated:

        WRITE(*,FMT='(2X,2(I4,1X),''name '',A4,F13.5,1X,E13.5)') &
              77778,3,'ABCDEFGHI',14.45,14.5666666
gives
bb****bbbb3bnamebABCDbbbbb14.45000bbb0.14567E+02

where the b signifies a blank! In the above example, the first INTEGER is unable to be written as the number is too long and the last REAL number is rounded to fit into the spaces available. The string is truncated to fit into the space available. A READ statement could use the same format editor.

Type coercion is not performed so INTEGER s cannot be written out as REAL s.

Return to corresponding overview page gif


next up previous contents
Next: Other I/O Statements Up: Input / Output Previous: FORMAT Statement / FMT=

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.