[comp.lang.fortran] Using READ without an iolist?

jlg@lanl.gov (Jim Giles) (04/18/89)

From article <520@orange19.qtp.ufl.edu>, by bernhold@qtp.ufl.edu (David E. Bernholdt):
>        READ (LUOUT, *)

I'm not sure this is legal in the standard.  The description of list
directed I/O does not include the case of an empty I/O list.

> Also, if I change the statement to
>        READ (LUOUT,'(A)') JUNK
> with JUNK as some character variable, it works as I would expect.

Try the following:

      READ(LUOUT,'()')

This is required to work as you request.  ANSI X3.9-1978 FORTRAN 77
Page 13-3, lines 47-51:

      ...                         Note that an empty format
      specification of the form () may be used only if no list
      items are specified; in this case, one input record is
      skipped or one output record containing no characters is
      written.   ...