RosettaCodeData/Task/Keyboard-input-Flush-the-keyboard-buffer/DCL/keyboard-input-flush-the-keyboard-buffer.dcl
2023-07-01 13:44:08 -04:00

7 lines
243 B
Text

$ wait 0::10 ! gives us 10 seconds to get keystrokes into the type-ahead buffer
$ on control_y then $ goto clean
$ set terminal /noecho
$ loop: read /prompt="" /time=0 sys$command /error=clean buffer
$ goto loop
$ clean:
$ set terminal /echo