home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
drcpas10.zip
/
SS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-11-17
|
1KB
|
50 lines
program ss;
uses crt, keyboard, scrsaver;
(* along with scrsaver.pas this is an example of the screen-saving
abilities of keyboard.pas. I also have code to allow mouse events
to update the 'lastkeypress' and a cool graphics screen saver,
as well as line-oriented input with editing (the screen saver will
not activate while a readln is pending), but that code is "not
ready for prime time." Expect it in 1.1, before the end of Nov 92.
The programmer must install a screen saving procedure to enable,
and setting @screensaver := nil; will disable it. Remember when
re-enabling the screen saver to reset the lastkeypress, e.g.
@screensaver := nil;
...
lastkeypress := ClockTix;
screensaver := mysaver;
The timeout defaults to five minutes (5460 clock ticks); it can
be set, e.g. timeout := 10 * 60 * TIX_PER_SECOND; (ten minutes)
*)
var
ch : char;
begin
screensaver := savescr;
timeout := 91; (* five seconds: default is five minutes *)
textcolor (yellow);
textbackground (blue);
repeat
clrscr;
gotoxy (30, 9);
write ('D - Do nothing');
gotoxy (30, 10);
write ('E - Exit');
gotoxy (30, 12);
write ('Choose: ');
repeat
ch := upcase(readkey);
until ch in ['D','E'];
writeln (ch);
until ch = 'E';
textcolor (lightgray);
textbackground (black);
clrscr;
end.