t70_kbd.pas 688 B

1234567891011121314151617181920
  1. program t70_kbd;
  2. { t70 -- Read(Kbd, Ch): a READ with a leading FILE argument. CALC.INC is full
  3. of `Read(Kbd, Ch)' (8 times) and `KeyPressed'.
  4. `Kbd' is the predefined console keyboard, modelled as a TEXT file. This
  5. runtime's read entries already read the console, so the leading file is
  6. DROPPED and the remaining arguments are read exactly as `Read(Ch)' would be.
  7. A real file variable in that position is a loud ENoLib, not a silent read
  8. into the file variable's own bytes.
  9. The .in is `Z'; the .out is `Z' + CRLF. Read (not ReadLn) leaves the newline
  10. pending, and the writeln after it adds the CRLF. }
  11. var
  12. ch : char;
  13. begin
  14. Read (Kbd, ch);
  15. writeln (ch)
  16. end.