Re: Need interpretation
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Thu, 22 Dec 2005 23:57:33 -0800
Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx> wrote:
[code elided]
> read(10,cmft,iostat=ierr) i ! this should generate an eof error
Please note that eof is *NOT* an error.
> I think "2" should be the output on the last line, but some
> compilers don't handle the implicit endfile correctly and they print
> out "1" instead. My version of gfortran happens to print out "0",
> which is just an outright error I think.
>
> Is it correct that the standard does define what the above program
> should write in that last write statement?
Yes. And yes, it should be a 2. The first backspace backspaces over the
(possibly virtual) endfile record. The second backspaces over the "2"
record.
I haven't experimented with this in recent years myself, but I've been
told that most compilers get it right these days. I can't vouch for how
accurate that is.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Need interpretation
- From: Gary L. Scott
- Re: Need interpretation
- From: Ron Shepard
- Re: Need interpretation
- References:
- Need interpretation
- From: Jerry DeLisle
- Re: Need interpretation
- From: Ron Shepard
- Need interpretation
- Prev by Date: Re: Need interpretation
- Next by Date: Re: Writing ANSI escape sequences from FORTRAN under Win2K using Visual Fortran
- Previous by thread: Re: Need interpretation
- Next by thread: Re: Need interpretation
- Index(es):