home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / ANSICRT2.ZIP / TESTANS.PAS < prev   
Pascal/Delphi Source File  |  1993-03-19  |  2KB  |  94 lines

  1. Uses ANSIcrt;
  2.  
  3. var
  4.  x, y, i : byte;
  5.  NameStr : string;
  6.  ch      : char;
  7.  
  8. begin
  9.   TextBackground(Black);
  10.   TextColor(LightGray);
  11.   ClrScr;
  12.   x := 0;
  13.   y := 0;
  14.   Write('Test of ANSCRT unit. @');
  15.   x := WhereX;
  16.   y := WhereY;
  17.   GotoXY(12,22);
  18.   TextColor(White + Blink);
  19.   Write('The @ sign above is on line ',y,' at column ',x - 1);
  20.   GotoXY(1,y + 1);
  21.   TextColor(Yellow);
  22.   TextBackground(Green);
  23.   Write('(Bright yellow on green.)  Enter your name (in Bright cyan on blue): ');
  24.   TextColor(LightCyan);
  25.   TextBackground(Blue);
  26.   ClrEol;
  27.   WHILE Keypressed DO
  28.   begin
  29.    ch := readkey;
  30.    write(Ord(ch),'=');
  31.   end;
  32.   ReadLn(NameStr);
  33.   LowVideo;
  34.   Write('Test LowVideo, Keypressed and ReadKey - Press any function key');
  35.   Repeat until Keypressed;
  36.   ch := ReadKey;
  37.   If ch = #0 then
  38.    begin
  39.      TextColor(White + Blink);
  40.      Write(' Special key');
  41.      ch := ReadKey;
  42.      TextColor(cyan);
  43.    end;
  44.   WriteLn;
  45.   HighVideo;
  46.   WriteLn('Test HighVideo and GetKey - Press another key');
  47.   ch := ReadKey;
  48.   If ch = #32 then Write('Space');
  49.   If ch = #9  then Write('Tab');
  50.   If ch = #8  then Write('Backspace');
  51.   Write(' ',ch);
  52.   GotoXY(1,22);
  53.   LowVideo;
  54.   ClrEol;
  55.   Write('Test of ClrEol - Press a key');
  56.   ch := ReadKey;
  57.   TextColor(White);
  58.   TextBackground(Red);
  59.   GotoXY(1,22);
  60.   ClrEol;
  61.   Write('All gone in white on red');
  62.   Write('    Press any key');
  63.   ch := ReadKey;
  64.   GotoXY(1,22);
  65.   NormVideo;
  66.   ClrEol;
  67.   Write('Press any key for color demo');
  68.   ch := ReadKey;
  69.   WriteLn(ch);
  70.   ClrScr;
  71.   for i := 0 to 7 do
  72.     begin
  73.       GotoXY(1,i + 1);
  74.       TextColor(i);
  75.       TextBackground(Black);
  76.       ClrEol;
  77.       Write('TextColor ',i);
  78.       TextColor(i + 8);
  79.       Write(' TextColor ',i + 8:2);
  80.       TextColor(i + Blink);
  81.       Write(' TextColor ',i + Blink);
  82.       TextColor(i + 8 + Blink);
  83.       Write(' TextColor ',i + 8 + Blink);
  84.       TextBackground(i);
  85.       ClrEol;
  86.       TextColor(White);
  87.       Write('  TextBackground ',i);
  88.     end;
  89.       TextBackground(Black);
  90.       LowVideo;
  91.       WriteLn;
  92.       WriteLn;
  93.       Write('Finished');
  94. end.