home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
ANSICRT2.ZIP
/
TESTANS.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1993-03-19
|
2KB
|
94 lines
Uses ANSIcrt;
var
x, y, i : byte;
NameStr : string;
ch : char;
begin
TextBackground(Black);
TextColor(LightGray);
ClrScr;
x := 0;
y := 0;
Write('Test of ANSCRT unit. @');
x := WhereX;
y := WhereY;
GotoXY(12,22);
TextColor(White + Blink);
Write('The @ sign above is on line ',y,' at column ',x - 1);
GotoXY(1,y + 1);
TextColor(Yellow);
TextBackground(Green);
Write('(Bright yellow on green.) Enter your name (in Bright cyan on blue): ');
TextColor(LightCyan);
TextBackground(Blue);
ClrEol;
WHILE Keypressed DO
begin
ch := readkey;
write(Ord(ch),'=');
end;
ReadLn(NameStr);
LowVideo;
Write('Test LowVideo, Keypressed and ReadKey - Press any function key');
Repeat until Keypressed;
ch := ReadKey;
If ch = #0 then
begin
TextColor(White + Blink);
Write(' Special key');
ch := ReadKey;
TextColor(cyan);
end;
WriteLn;
HighVideo;
WriteLn('Test HighVideo and GetKey - Press another key');
ch := ReadKey;
If ch = #32 then Write('Space');
If ch = #9 then Write('Tab');
If ch = #8 then Write('Backspace');
Write(' ',ch);
GotoXY(1,22);
LowVideo;
ClrEol;
Write('Test of ClrEol - Press a key');
ch := ReadKey;
TextColor(White);
TextBackground(Red);
GotoXY(1,22);
ClrEol;
Write('All gone in white on red');
Write(' Press any key');
ch := ReadKey;
GotoXY(1,22);
NormVideo;
ClrEol;
Write('Press any key for color demo');
ch := ReadKey;
WriteLn(ch);
ClrScr;
for i := 0 to 7 do
begin
GotoXY(1,i + 1);
TextColor(i);
TextBackground(Black);
ClrEol;
Write('TextColor ',i);
TextColor(i + 8);
Write(' TextColor ',i + 8:2);
TextColor(i + Blink);
Write(' TextColor ',i + Blink);
TextColor(i + 8 + Blink);
Write(' TextColor ',i + 8 + Blink);
TextBackground(i);
ClrEol;
TextColor(White);
Write(' TextBackground ',i);
end;
TextBackground(Black);
LowVideo;
WriteLn;
WriteLn;
Write('Finished');
end.