Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!news.funet.fi!uwasa.fi!ts From: ts@uwasa.fi (Timo Salmi) Newsgroups: comp.lang.pascal Subject: Re: Help needed - ticking clock impl. Message-ID: <1991Apr17.025737.27870@uwasa.fi> Date: 17 Apr 91 02:57:37 GMT References: <1991Apr16.124739.18124@hubcap.clemson.edu> Organization: University of Vaasa Lines: 35 In article <1991Apr16.124739.18124@hubcap.clemson.edu> asolima@hubcap.UUCP (abdel w soliman) writes: : >I am writing a program in TP 5.5 and would like to implement a clock. I can >get the initial time by calling "GetTime" procedure, but I would like to make >it "tick" (on the screen) as my program is running. > >I got a program that does this (from uwassa- Prof. Salmi's program). >Unfortunatelly, only the executable file was available so I am puzzled and >eager to get something done but I have no idea how to start. : If you mean writing a resident clock, you'll find much useful code and information on this in Michael Tischer, Turbo Pascal Internals, Abacus. There is also another good reference. It is Michael Yester, Using Turbo Pascal, Que, pp. 561-. Perhaps that is the better starting point, since it is easier to understand. BTW, one does not use the GetTime procedure at all in a tick oriented TSR. I'm not quite sure why (perhaps a collision), but it just confuses things up. Also, it would seem that one has to use direct screen writes. On the other hand, if you want a clock that runs within a normal program, you just get the time with GetTime, convert the time into a suitable, normally an 8 character (12:34:56) string, and then write it at the desired location of the screen. There are two cathes. You'll have to take care that you program flow visits the routine often enough. You'll also have to take care, that unless the second is the next one, you don't write. If you do, you'll get a very annoying flicker effect in the clock. ................................................................... Prof. Timo Salmi Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37 School of Business Studies, University of Vaasa, SF-65101, Finland Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun