On Thu, 29 Nov 2001, Richard Maine wrote:
> Yes. Absolutely. (For formatted stream only - this isn't for
> formatted sequential, which remains as it is). I don't know why you
> are so surprised. This is *EXACTLY* what C does.
Thanks, Richard, for taking the time to explain this. I guess I was
surprised because I expected the new stream I/O facility to give Fortran
users, essentially for the first time, the ability to be able to do I/O
with a one-to-one correspondence between what is in the file and what is
read into memory (and vice-versa for output), e.g. you should be able to
count characters output and be sure that your file would end up with the
same number of bytes in the same order. The translation of ACHAR(10) to
more than one character (on some operating systems) violates this
assumption. Maybe it's the right thing to to, since C does the same.
But I wouldn't want Fortran to emulate all the features of C, just for the
sake of compatibility.
I'm now just about convinced that this is the right thing to do, but am
still a bit confused by what happens on input, having read various
subsequent messages. It does seem to me important that input and output
have exactly reciprocal translations.
> > Are there other substitutions, e.g. achar(0), or achar(26)?
>
> No.
I'm pleased to hear that. Keep up the good work.
--
Clive Page, /"\ ASCII ribbon
Dept of Physics & Astronomy, \ / campaign against
University of Leicester. X HTML mail
U.K. / \ and postings
|