home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
MCLK100.ZIP
/
MCLK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-08-19
|
2KB
|
100 lines
program movingclock;
uses crt ,
dos ;
const
progdata = 'MCLK- Free DOS utility: colorful moving clock display.';
progdat2 = 'V1.00: August 19, 1993. (c) 1993 by David Daniel Anderson - Reign Ware.';
usage = 'Usage: MCLK';
var
rtcol,
btrow,
xcord,
ycord : byte ;
dum : char ;
procedure showhelp;
begin
writeln (progdata);
writeln (progdat2);
writeln (usage);
halt ;
end;
procedure cursoroff ;
var
regs : registers ;
begin
regs.ah:=$01 ;
regs.ch:=$20 ;
regs.cl:=$20 ;
intr ( $10,regs) ;
end ;
procedure cursoron ;
var
regs : registers ;
begin
regs.ah:=$01 ;
regs.ch:=$0 ;
regs.cl:=$1 ;
intr ( $10,regs) ;
end ;
function leadingzero(w : word) : string;
var
s : string;
begin
str(w:0,s);
if length(s) = 1 then
s := '0' + s;
leadingzero := s;
end;
procedure ddate;
var
h,mi,s,u : word ;
date_time : datetime ;
begin
gettime (h,mi,s,u);
with date_time do
begin
hour := ( h );
write ( leadingzero ( hour ) , ':' );
min := ( mi );
write ( leadingzero ( min ) , ':' );
sec := ( s );
write ( leadingzero ( sec ));
end;
end;
begin
if paramcount <> 0 then showhelp;
rtcol := lo ( windmax ) - 7 ;
btrow := hi ( windmax ) + 1 ;
textattr := 8;
clrscr ;
randomize ;
cursoroff ;
while not keypressed do begin
textattr := succ ( textattr );
if ( textattr = 16 ) then
textattr := 9;
xcord := 1 + random ( rtcol ) ;
ycord := 1 + random ( btrow ) ;
gotoxy ( xcord , ycord );
ddate ;
delay ( 990 ) ;
clrscr ;
end;
while keypressed do dum := readkey ;
cursoron ;
end.