home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / KEYTEST / Keytest.pas < prev   
Pascal/Delphi Source File  |  1998-05-12  |  607b  |  25 lines

  1. {$APPTYPE CONSOLE}
  2. (*
  3.  * This simple program demonstrates CRT I/O. Compile the
  4.  * program from a DOS prompt window using the command:
  5.  *
  6.  * dcc32 -cc keytest
  7.  *
  8.  * Type KEYTEST and press Enter to run the program from
  9.  * a DOS-prompt.
  10.  *)
  11. program KeyTest;
  12. var
  13.  Ch: Char;
  14. begin
  15.   Writeln('Keyboard tester. Press <key>+Enter.');
  16.   Writeln('To quit, press Ctrl+C,');
  17.   Writeln('or close the window.');
  18.   Writeln;  { Output a blank line }
  19.   repeat
  20.     Read(Ch);             { Read from keyboard }
  21.     Writeln(Ord(Ch):4);   { Show its value }
  22.   until False;  { That is, "forever." }
  23. end.
  24.  
  25.