home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6350 < prev    next >
Encoding:
Internet Message Format  |  1992-11-05  |  927 b 

  1. Path: sparky!uunet!caen!uwm.edu!csd4.csd.uwm.edu!randyd
  2. From: randyd@csd4.csd.uwm.edu (Randall Elton Ding)
  3. Newsgroups: comp.lang.pascal
  4. Subject: reading alternate keys on ibm from turbo
  5. Date: 5 Nov 1992 19:16:34 GMT
  6. Organization: Computing Services Division, University of Wisconsin - Milwaukee
  7. Lines: 33
  8. Distribution: usa
  9. Message-ID: <1dbruiINNbai@uwm.edu>
  10. NNTP-Posting-Host: 129.89.7.4
  11.  
  12. Someone asked for a program to read alternate keys from the IBM,
  13. Here it is...
  14.  
  15. from: randyd@csd4.csd.uwm.edu
  16.  
  17. program ibmkeyread;
  18.  
  19. uses crt;
  20.  
  21. procedure keyread (var ch: char; var alt: boolean);
  22.   begin
  23.     ch:= readkey;
  24.     alt:= (ch=#0) and keypressed;
  25.     if alt then ch:= readkey;
  26.   end;
  27.  
  28. procedure main;
  29.   var
  30.     ch: char;
  31.     alt: boolean;
  32.  
  33.   begin
  34.     repeat
  35.       keyread (ch,alt);
  36.       if alt then write ('alt - ');
  37.       writeln (ch,'   ',ord (ch));
  38.     until (ch=#27) and (not alt);   { esc key }
  39.   end;
  40.  
  41. begin
  42.   main;
  43. end.
  44.  
  45.