Path: g2news2.google.com!postnews.google.com!x3g2000yqa.googlegroups.com!not-for-mail From: feenberg Newsgroups: comp.lang.fortran Subject: Re: EOF idiom? Date: Fri, 24 Apr 2009 06:01:34 -0700 (PDT) Organization: http://groups.google.com Lines: 38 Message-ID: <1e248e7f-3d47-4e68-aefa-a944fb5a1957@x3g2000yqa.googlegroups.com> References: <75dpn7F17gd1jU1@mid.individual.net> NNTP-Posting-Host: 71.184.181.57 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1240578094 24492 127.0.0.1 (24 Apr 2009 13:01:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Apr 2009 13:01:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x3g2000yqa.googlegroups.com; posting-host=71.184.181.57; posting-account=UKzVQwoAAAC0p4fW4nFhSsDyRRVgSJiF User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.64 (Windows NT 5.1; U; en) Presto/2.1.1,gzip(gfe),gzip(gfe) On Apr 24, 8:30=A0am, Bruce Bowler wrote: > What's the (standard conforming) Fortran 95 way to deal with > > 10 read (blah,end=3D20) > =A0 =A0process stuff > =A0 =A0goto 10 > 20 close (blah) That's the way I do it. > > In many other languages I'd do something like > > read (blah) > do while not eof(blah) > =A0 process stuff > =A0 read (blah) > end do > > but there doesn't seem to be an eof function in Fortran The advantage of end=3D over eof(unit) is that the read statement doesn't need to be repeated. I'd say that was a real advantage in terms of "edit sensitivity". I agree the statement numbers are primitive. I expect that somehow the INQUIRE statement can be used to create and eof function (perhaps with the POSITION qualifier equal to "APPEND"), but I haven't tried that. Daniel Feenberg > > Thanks > Bruce