BBS: Inland Empire Archive Date: 02-13-93 (03:24) Number: 225 From: SEAN SULLIVAN Refer#: NONE To: ALL Recvd: NO Subj: Moving Clock Screen Saver Conf: (2) Quik_Bas
Greetings and Salutations All!
This is something I whipped up out of boredom. Feel free to do what you
wish with it. This means you too, Lee.
----------------8< cut here >8--------------------------------------------
':::::::::::: MOVING CLOCK SCREEN BLANKER :::::::::::::::::
'Written by: Sean P. Sullivan
' February 13, 1993
'
'A simple screen blanker routine. It will display the
'current time, moving it's position once every second.
'It is currently set to run using SCREEN 1 to take
'advantage of the larger characters. See program comments
'on how to change to different screens.
'This should work on most BASICS from GW to VB.
'
'This code is released to the public domain.
'It may be printed, used, changed, whatever.
'Printable in QBS: YES!
'
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
DEFINT A-Z
'---- starting row ----
row = 1
'---- starting col ----
col = 1
'---- screen mode (default 1-CGA) ----
scrn = 1
'---- # cols for SCREEN mode, subtract 14 from max cols ----
'---- to prevent clock from printing off screen ----
'---- ie: CGA max cols=40, so clim=39-14 or 25 ----
clim = 25
'---- # rows for SCREEN mode, usually always 23 ----
rlim = 23
'---- freq of clock update (default=1 sec) ----
freq = 1
'start TIMER
TIMER ON
'set screen mode
SCREEN scrn
'for every change in the timer by the freq amount gosub ShowClock
ON TIMER(freq) GOSUB ShowClock
'loop until a key is pressed
DO
LOOP WHILE INKEY$ = ""
END
'turn timer off and exit program
TIMER OFF
END
'Show clock subroutine
ShowClock:
'clear out old clock position
LOCATE row, col: PRINT SPACE$(14)
'find new row position between 0-23
row = 99
DO WHILE row > rlim
row = INT(RND(1) * 100) + 1
LOOP
'find new column position between 0-25
col = 99
DO WHILE col > clim
col = INT(RND(1) * 100) + 1
LOOP
'print clock at new position
LOCATE row, col: PRINT "Time: "; TIME$
RETURN
------------------------8< cut here >8--------------------------------
Sean
--- GoldED 2.40.P0623
* Origin: COMNET Point #28 [Watervliet, NY] (1:267/113.28)

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