
Input/Output |
6.3.1.2 Input List
The list
6.3.1.3 Implied-DO List
An
(in-list, var = el, e2, e3)
where 'var, el, e2, and e3' have the same interpretation as for the DO statement (section 4.2.2) and
For READ statements, the DO variable 'var' must not appear as an item in
Example:
CREAD ONLY THE ODD ELEMENTS IN ARRAY 'TABLE' DIMENSION TABLE(60)
READ (2, 20) (TABLE(N), N = 1,59,2)
20FORMAT ...
6.3.2WRITE Statement
The WRITE statement outputs data to a specified unit. The format of the WRITE statement is
WRITE (ctl-list) [out-list]
where
The control information list is the same as for the READ statement (section 6.3.1.1 and following subsections) except that no END specifer is allowed. The output list
Like input list items, an output list item may be a variable name, array name, or ar- ray element name. An output list item may also be an expression, including an ex- pression involving operators or enclosed in parentheses.
Examples:
WRITE (6,120) PNAME, AVG
120 FORMAT ...
WRITE (6,120,IOSTAT= ERRFLG, ERR=2000) &PNAME + I, AVG + I
120 FORMAT ...
DIMENSION PNAME(25), AVG(25)
C WRITE DOUBLE COLUMN PRINTOUT OF FIRST ITEMS OF C EACH ARRAY
WRITE (6,120)(PNAME(K), AVG(K), K=1, 10)
120 FORMAT (1X, A, 5X, F4.3)