I have a question about write statements with `advance="no"'. Two
compilers that I use treat them differently.
(a) One compiler writes a complete record with no terminating newline,
and sends it to the output.
(b) The other apparently writes a part record, but doesn't send it to
the output. Instead it sits on it until there is a write statement
without `advance="no"', and only then writes out the entire
record.
Version (b) doesn't do what I want in an interactive program with both
input from and output to the terminal. I expect the code
write ("(a)",advance="no") "prompt: "
read ... stuff
to send the prompt to the terminal and wait for the user to type the
stuff. According to Metcalf & Reid this is one of the uses for
non-advancing output. Compiler (b) doesn't produce the prompt until
after the stuff has been entered and the program is ready to print
something else.
Does the standard specify what should happen? Is this a bug in
compiler (b)?
--
Anthony Stone http://www-stone.ch.cam.ac.uk/
University Chemical Laboratory, Email: [log in to unmask]
Lensfield Road, Phone: +44 1223 336375
Cambridge CB2 1EW Fax: +44 1223 336362
|