Friday, 23 August 2013

Writing on the same line in FORTRAN

Writing on the same line in FORTRAN

In FORTRAN, each time one uses WRITE a new line is produced. In order to
control the working of a program that is being executed, I would like to
write on screen the current value of a variable, but always on the same
line (erasing the previous value and starting at the beginning of the
line). That is, something like
1 CONTINUE
"update the value of a"
WRITE(*,*) a
BACKSPACE "screen"
GOTO 1
Something like WRITE(*,*,ADVANCE='NO') (incorrect anyway) is not quite
what I need: this would write all the values of "a" one after another on a
very long line.
Thanks in advance

No comments:

Post a Comment