From:	CSBVAX::MRGATE!FETZER@NMFECC.ARPA@SMTP 11-APR-1988 11:46
To:	ARISIA::EVERHART
Subj:	Another FORTRAN CLOCK...


Received: from NMFECC.ARPA by KL.SRI.COM with TCP; Thu 7 Apr 88 17:04:30-PDT
Received: from ccc.mfenet by ccc.mfenet with Tell via MfeNet ;
	Thu, 7 Apr 88 17:02:02 PDT
Date:	  Thu, 7 Apr 88 17:02:02 PDT
From:     FETZER@NMFECC.ARPA
Message-Id: <880407170202.2120021c@NMFECC.ARPA>
Subject:   Another FORTRAN CLOCK...
To:       INFO-VAX@KL.SRI.COM
Comment: From FETZER@CCC.MFENET on  7-APR-1988 17:01:41.67 PDT

Looks like all of a sudden everyone is interested in having a running
clock on the screen.  My solution was to reserve the last line of the screen
for the clock, that way it doesn't interfere with anything.  One problem you
might run into: most screen oriented editors, for example, reset the scrolling
region to the entire screen upon exiting.  I've gotten around that by
writing a dcl procedure to start the editor and take care of the scrolling
after it exits.  One might simply move the line 'print*,esc....'
inside the do loop, though, and have
everything reset each time the clock is updated.  Incidentally, you will
probably want to change how often the clock update occurs, I do it every
15 sec.

Here it is:
        PROGRAM CLOCK
C       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
C       !                                                                    !
C       !                           CLOCK.FOR                                !
C       !                                                                    !
C       !     This program is meant to be spawned in a subprocess.  The      !
C       !  cursor position and attributes are saved, the video is set to     !
C       !  reverse-dim, and the cursor is moved by direct address command    !
C       !  to the appropriate screen location to print the date and time.    !
C       !  Then the video is set back to normal and the cursor position      !
C       !  and attributes are restored.                                      !
C       !                                                                    !
C       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        CHARACTER*9 DAT
        CHARACTER*8 TIM
        CHARACTER*1 ESC
        DIMENSION ITIME(2)
        ITIME(1)=-15E7
        ITIME(2)=-1
        ESC = CHAR(27)
        print*,esc,'[0;23r'
30      CALL DATE(DAT)
        CALL TIME(TIM)
        SEC = SECNDS(0.0)
        print100,esc,'7',esc,'[1;7m',esc,'[24;63H',DAT,' ',
     1       TIM,esc,'[0m',esc,'8'
100     format ('+',A1,A1,A1,A5,A1,A7,A9,A1,A8,A1,A3,A1,A1,$)
        CALL SYS$SCHDWK (,,ITIME,)
        CALL SYS$HIBER
        GOTO 30
        END

 ---------------------------------------------------------------
| Michael Fetzer						|	
|								|
| U. C. S. D.			  T. S. R. Inc.			|
| Dept. of Physics  B-019	  3933 1/2 Riviera Dr.		|
| La Jolla, CA			  San Diego CA  92109		|
| (619) 534-5304		  (619) 270-4965		|
|								|
| Internet:	FETZER@nmfecc.ARPA				|
| MFEnet:	FETZER@ccc.mfenet				|
| BITNET: 	FETZER%ccc.mfenet@SDSC.BITNET			|
| HEPnet:	CSA::"FETZER@ccc.mfenet"			|
 ---------------------------------------------------------------



