

Task

Obtain a valid   Y   or   N   response from the keyboard.

The keyboard should be flushed, so that any outstanding key-presses are removed, preventing any existing   Y   or   N   key-press from being evaluated.

The response should be obtained as soon as   Y   or   N   are pressed, and there should be no need to press an   enter   key.




PROC MAIN()
 Byte Key=764
 
 Printe("Press Y or N to continue")
 
 key=255
 
 Do
  Until Key=43 or Key=35
 Od
 
 Print("You pressed ")
 If Key=43 then Printe("Yes") Fi
 If Key=35 then Printe("No ") Fi
 
RETURN