Walter,
I am using fortran90. I will look at this tomorrow and let you know if it works.
Thanks.
--- On Sat, 2/14/09, Walter Spector <w6ws@...> wrote:
From: Walter Spector <w6ws@...>
Subject: Re: [Fortran] Re: Progress Indicator
To: Fortran@yahoogroups.com
Date: Saturday, February 14, 2009, 3:45 PM
William Kasirye wrote:
> I used the print, but the problem is that, it does not 'override' what
>has been printed.
Which compiler are you using? The following spins for 10 seconds,and
reports when the seconds element changes. It works with current versions
of g95, gfortran, and Silverfrost FTN95 - as they apparently don't do
much buffering:
program indicate
implicit none
integer, parameter :: max_secs = 10
character, parameter :: cr = achar (13) ! ASCII carraige return (not newline)
integer :: timevals(8)
integer :: current_sec, old_sec
integer :: i
old_sec = 0
i = 0
do
call date_and_time (values=timevals)
current_sec = timevals(7)
! Tell user when the seconds element changes
if (current_sec /= old_sec) then
write (6,'(a,i2,a) ',advance= 'no') 'current second = ', current_sec, cr
old_sec = current_sec
i = i + 1
end if
if (i == max_secs) exit
end do
write (6,*)
end program
With ifort, the I/O buffer doesn't get flushed, even though I tried
putting in F2003 flush statement after the write statement. I should
probably report it to them.
It also works fine with MIPSPro f90.
W.
[Non-text portions of this message have been removed]