> On Wed, 28 Jan 2004, Alvaro Fernandez wrote:
>
> > I suspect this has been covered before, but I am not sure.
> >
>
> > What I would like to do is to write an integer counter to the same spot on
> > the screen repeatedly without moving the cursor:
>
> >
> > Using ADVANCE="NO" in the write statement merely makes the cursor go to the
> > left, as in my second example - no carriage return, but I do get cursor
> > motion. Is there a way to just print in the same spot?
and Renchi Raju continued
> fortran 90 doesn't have this feature. only portable way might be interface
> with a C function.
The "+" vertical format control character is supposed to do this, regardless
of whether ADVANCE="NO" is specified. See section 9.4.5 of the Fortran 90
standard. As far as I know, the Lahey 16-bit Fortran 77 processor for DOS
was the only one that got this right. It *did not* advance until the next
record was output. On Unix, the response was "Use the 'ansi' filter." Well,
that didn't work on the terminal because every Fortran run-time library
insisted on buffering output through a pipe. Maybe Unix insisted and the
Fortran libraries couldn't insist on no buffering. Anyway, nobody got it
right on Unix.
I would have expected putting a "T1" at the end of the format would work,
but of the two processors I tried on Linux, one reported an I/O error, and
the other didn't tab back to column 1.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.
|