Folks,
if you want to repeatedly write to the same line on the screen
then using simple ANSI codes works 99% of the time.
just add char(27)//'[A' to the end of your WRITE lines
eg. consider the following which will write a progress bar across the screen...
DO IEL=1,NEL
IPERCENT = nint(100.*REAL(IEL)/REAL(NEL))
IF (IPERCENT.NE.IPERCENT_OLD) CALL BAR_LINE (IPERCENT,IPERCENT_OLD, 79)
...
ENDDO
...
!-----------------------------------------------------------------------
SUBROUTINE BAR_LINE (IPERCENT,IPERCENT_OLD, iwidth )
!
! Shows the status bar 0 to 100%
! eg. ********.......27%............
! Dan Kidger 10-3-97
!
INTEGER IPERCENT,IPERCENT_OLD, IWIDTH
CHARACTER LINE*255
IFRAC = NINT (IWIDTH * (IPERCENT/100.))
DO I=1,IFRAC
LINE(I:I) = '*'
ENDDO
DO I=IFRAC+1,IWIDTH
LINE(I:I) = '.'
ENDDO
ip = iwidth/2+1
line(ip:ip)='%'
ival = ipercent
12 ip = ip -1
line(ip:ip) = char(ichar('0')+mod(ival,10) )
ival = ival/10
if (ival.ne.0) goto 12
WRITE (*,'(A,A)') LINE(1:IWIDTH), char(27)//'[A'
IPERCENT_OLD= IPERCENT
RETURN
END
!-----------------------------------------------------------------------
Hope this helps
Daniel.
--------------------------------------------------------------
Dr. Dan Kidger, Quadrics Ltd. [log in to unmask]
One Bridewell St., Bristol, BS1 2AA, UK 0117 915 5505
----------------------- www.quadrics.com --------------------
|