例如:
  var
    key: word;
   begin
    if {没有键盘按下//这里怎样写?} then
       key:=...;
    else
       key:=ord(readkey);
   end;
是dos trubo pascal7.0下。谢谢!!!

解决方案 »

  1.   

    sorry,It should be "read".
      

  2.   

    KeyPressed (function)     (Crt unit and WinCrt unit)
      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
     Determines if a key has been pressed on the keyboard.  Declaration:
      function KeyPressed: Boolean;  Target:
     Windows, Real, Protected  Res:
     The key can be read using the ReadKey function.  Return Value:
     True If key has been pressed False If key has not been pressed  Sample Code:  {KeyPress.PAS}  {Sample code for the KeyPressed function.}
      { For Windows: }
      { uses WinCrt; }  uses Crt;  begin
       repeat
         Write('Xx');
       until KeyPressed;
      end.