[comp.os.vms] Continuously running clock

rostamia@umbc3.UMD.EDU (Dr. Rouben Rostamian ) (03/06/88)

This may be a very superfluous thing to do, but I would like to be able
to do it, anyway:  How can I have a continuously running clock displayed
on my screen?  Something that prints, for instance 11:34:48, at the
first row, 60th column of the screen, and updates itself every second,
thus simulates a "status line."
I have tried this in various ways: in a DCL command procedure, a PASCAL
routine using smg$, and system services.  In each case I have created a
subprocess which gets the time from the machine and displays it in the
desired location of the screen (via an smg$ virtual display, for
example.)  The trouble is, although the clock runs, the cursor jumps say
every second, to the top row of the screen to update the clock display.
So if I am in the middle of typing a DCL command in the bottom of
screen, part of my command appears on top of the screen near the
clock display.  

Is there a way to print to the screen without having to move the cursor
around? (Isn't this a silly question!)

rrk@byuvax.bitnet (03/07/88)

First make sure that your entire update occurs in a single QIO -- Just be
sure you concat everything together before sending it out.  Then add <ESC>7
to the beginning of the string (this saves the cursor position) and <ESC>8
to the end.  I've used this for lots of things and it works as long as your
clock update doesn't do something stupid like scrolling the display.  Naturally
if your display scrolls anyway, your previous clock will have moved, etc.

I don't know of an easy way to do this through SMG, and I'm not likely to
look since my opinion of SMG as it currently exists is very low.

jdc@beach.cis.ufl.edu (Jeff Capehart) (03/20/88)

I already have a fairly short program that runs as a subprocess with
256 pages of page file quota, needs only 1 minute of cpu to run about
4 hours, and sets the scrolling region so that it won't scroll off,
provides a symbol, freeze, which will reset the scrolling region when
the editor messes it up, and it updates once every second unless you
start typing on the command line.  I have found that the only way to
keep it from scrolling is to not use the IO$M_BREAKTHRU and just let
the IO's pass during I/O but not typing IO.  The only other problem
it has is that sometimes it will jump.  This is particularly noticeable
when the cursor is set beyond the 80 cols and an attempt to restore
the position with <ESC> 7 and <ESC> 8 resets it to the beginning of next
line.  I will send anyone who wants a copy, or if there are enough
requests, I can just post to the net since it is only about two pages
long.

--
Jeff Capehart 		Internet: jdc@beach.cis.ufl.edu
University of Florida	UUCP:   ..!ihnp4!codas!uflorida!beach.cis.ufl.edu!jdc