Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!rutgers!mit-eddie!apollo!geiser
From: geiser@apollo.uucp (Wayne Geiser)
Newsgroups: comp.lang.fortran
Subject: Re: end= with no input variables ?
Message-ID: <3262a812.71d0@apollo.uucp>
Date: Thu, 8-Jan-87 13:48:25 EST
Article-I.D.: apollo.3262a812.71d0
Posted: Thu Jan  8 13:48:25 1987
Date-Received: Thu, 8-Jan-87 22:39:50 EST
References: <44400008@hcx1> <11040@sun.uucp> <511@aw.sei.cmu.edu.sei.cmu.edu>
Organization: Apollo Computer, Chelmsford, Mass.
Lines: 30


    I agree with Steve Dever.  In section 13.3 (page 13-3 lines 47 through 51) the Standard says:

         ... 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. ...

    I realize that the example given (READ(11,'(I5)',END=10)) does, indeed contain a format
specification.  The control for the read comes from the io list as described in the same section
(13.3 page 13-4 lines 16 through 22):

         Whenever format control encounters a repeatable edit descriptor in a format specification,
         it determines whether there is a corresponding item specified by the input/output list.
         If there is such an item, it transmits appropriately edited information between the item
         and the record, and then format control proceeds.  If there is no corresponding item,
         format control terminates.

    Obviously, in this case 'format control terminates' with the first edit descriptor.  The input
record (in this case an endfile record) is still 'skipped' and the end-of-file condition exists as
per the definition in section 12.6 (page 12-8 lines 47 through 53):

         An end-of-file condition exists if either of the following events occurs:

              (1) An endfile record is encountered during the reading of a file connected for
                  sequential access.  In this case, the file is positioned after the endfile
                  record.

                        Wayne Geiser
                        Apollo Computer, Inc.
                        {wanginst, yale, uw-beaver, brunix, utah-cs}!apollo!geiser