ONScreen clock

 BBS: Inland Empire Archive
Date: 05-02-92 (20:24)             Number: 151
From: MARTY DUPLISSEY              Refer#: NONE
  To: TIM FITZGERALD                Recvd: NO  
Subj: ONScreen clock                 Conf: (2) Quik_Bas
Blabbering as if I knew what I was talking about!

In a msg of <30 Apr 92>, Tim Fitzgerald mumbled incoherently to Miles Hufford:


 MH>->> of a loop, and I'm able to put my clock routine inside
 MH>->> of tha        function. I would like to have a function that is
 MH>->> not dependa        on such.
 MH>> You can try using the ON KEY statement to trap keys.  For your
 MH>> clock you may wanna use the ON TIMER statement to cause you program
 MH>> to jump to your clock print routine every so often.


Tim here is a routine I use in a couple of applications I've written
for my work. I have posted it verbatim from my code.


declare sub clockput()

timer on

on timer (1) gosub putclock

Your program goes here


:putclock

clockput

return


SUB timeput
oldrow% = CSRLIN
oldcol% = POS(1)
LOCATE , , 0
COLOR 0, 7
dte$ = DATE$
dte$ = LEFT$(dte$, 6) + RIGHT$(dte$, 2)
IF LEFT$(dte$, 1) = "0" THEN dte$ = RIGHT$(dte$, 7)
LOCATE 25, 2: PRINT dte$;
msg$ = "GOOD MORNING"
tim$ = TIME$
IF VAL(LEFT$(tim$, 2)) > 11 THEN msg$ = "GOOD AFTERNOON"
IF VAL(LEFT$(tim$, 2)) > 12 THEN tim$ = STR$((VAL(LEFT$(tim$, 2)) - 12))_
 + RIGHT$(tim$, 6)
IF LEFT$(tim$, 2) = "00" THEN tim$ = "12" + RIGHT$(tim$, 6)
IF LEFT$(tim$, 1) = "0" THEN tim$ = RIGHT$(TIME$, 7)
LOCATE 25, 72: PRINT tim$;
LOCATE 25, 33: PRINT msg$;
LOCATE oldrow%, oldcol%
END SUB


Now this code has a little extra stuff that is custom but you can get the idea
of what I'm doing. It might slow down your program a bit
but I I have found it usefulit in my menus from one
application to another . I also use it inside some of them
where pure blazing speed is not inportant. I hope this
helps.

MARTY

--- GoldED 2.31p
 * Origin: World Link, Longview,TX.USA(903-643-7607) (1:398/1)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET