7.2.1.2 List-Directed Sequential READ Statement

The list-directed sequential READ statement performs the following operations:

The external records from which list-directed READ statements read data contain a sequence of values and value separators. A value in one of these records can be any one of the following:

A record can use any one of the following entities as a value separator, with or without surrounding spaces or tabs:

A slash (/) terminates processing of the input statement and the record, leaving all remaining I/O list elements unchanged.

When any of the preceding entities appear in a character constant, they are considered part of the constant, not value separators.

The end of a record is equivalent to a space character except when it occurs in a character constant. In this case, the end of the record is ignored, and the character constant is continued with the next record (the last character in the previous record is immediately followed by the first character of the next record).

Spaces at the beginning of a record are ignored unless they are part of a character constant continued from the previous record. In this case, the spaces at the beginning of the record are considered part of the constant.

Each input statement reads one or more records as required to satisfy the I/O list. If a slash separator occurs or the I/O list is exhausted before all of the values in a record are used, the remainder of the record is ignored.

Example

Consider a program unit with the following statements:

CHARACTER*14 C
DOUBLE PRECISION T
COMPLEX D,E
LOGICAL L,M
READ (1,*) I,R,D,E,L,M,J,K,S,T,C,A,B

The following external record is read:

4 6.3 (3.4,4.2), (3, 2 ) , T,F,,3*14.6 ,'ABC,DEF/GHI''JK'/

Upon execution of the program unit, the following values are assigned to the I/O list elements:

I/O List Element   Value  
6.3 
(3.4,4.2) 
(3.0,2.0) 
.TRUE. 
.FALSE. 
14 
14.6 
14.6D0 
ABC,DEF/GHI'JK 

A, B, and J are unchanged.


Previous Page Next Page Table of Contents