Re: Fortran 77 - File reading problem
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Mon, 22 Oct 2007 10:46:37 -0700
<holysword@xxxxxxxxx> wrote:
Sry. When I change the FORM I got no error at opening, But I got
IOSTAT=31 at reading.
You can't just change the OPEN without also changing the READ. Thay have
to match. That's what the error message is telling you, and it is so. If
you do a formatted OPEN, you must do a formated READ. If you do an
unformatted OPEN, you must do an unformatted READ. That doesn't actually
have anything to do with the content of the file; you can't do an
unformatted OPEN followed by a formatted READ, no matter what is on the
file. The content of the file would determine whether you should be
doing formatted or unformatted I/O, but a mix lik you have is always
wrong.
Looks to me like most of your problems relate to getting that wrong.
There might also be other problems, but it looks to me like you are
getting whatever real problems there might be mixed up with the problems
caused by not matching the OPEN and the READ. That is causing enough
"smoke" that I can't see through it to what might lie beyond.
Not that "read (30,*)" is a formatted read. I have seen people
incorrectly refer to it as unformatted, which causes no end of
confusion, possibly including yours.
If the file contains text that you can look at and make sense of, then
it is formatted. An unformatted file will look like gibberish if you try
to print or look at it.
--
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: Fortran 77 - File reading problem
- From: holysword
- Re: Fortran 77 - File reading problem
- References:
- Fortran 77 - File reading problem
- From: holysword
- Re: Fortran 77 - File reading problem
- From: holysword
- Fortran 77 - File reading problem
- Prev by Date: Re: Fortran 77 - File reading problem
- Next by Date: Re: Fortran 77 - File reading problem
- Previous by thread: Re: Fortran 77 - File reading problem
- Next by thread: Re: Fortran 77 - File reading problem
- Index(es):
Relevant Pages
|