Re: DISPLAY Time in a 4GL program
Posted in 1997
Jonathan Leffler wrote: > > >From: Guy Germonpre <germonpre_guy/dis@bekaert.com> > >Date: Fri, 18 Apr 1997 14:41:13 +0200 > >X-Informix-List-Id: <news.36810> > > > >I wish to have a display of the current time in a 4GL program. This time > >should be updated every minute, wether in input or not. > > A simple sounding request, but it is surprisingly difficult to do, for > reasons which I'll outline. How you implement a solution will be up to > you, but it probably isn't worth the effort. [Long, painful method clipped] I wimped out and took the easy approach to this once. I assume that your client-side environment must be terminals, otherwise the users could just put up the windows clock on their screens. So, what I did was to turn on the status line on the user's Wyse terminals. This puts up a clock for the users, which, unfortunately is incorrect unless the users turn on their terminals at exactly 8:00 a.m. every morning! :) Getting around that is easy, because the clock can be programmed. It's simple to get the system time and send the appropriate escape sequence (ESC c 8 hh mm on a Wyse 60--no spaces in there) to the terminal. This can be put in a stand-alone program that executes in their login profile, or in your main 4gl program. If you support more than one brand of teminal in your environment, it would be only marginally more difficult to add TERM environment checking and send alternate escape codes based on this variable. Every terminal I've seen in the last bunch of years has a programmable clock (though the list is admittedly not large). This should give you a clock that is accurate to the system's clock with little more than an hour our two's work. Maybe not as elegant, but certainly *much* more simple! :) Tim