

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.




/* NetRexx */
 
options replace format comments java crossref savelog symbols binary
 
Say 'Please enter Y or N'
parse ask c
Select
  when c='Y' Then Say 'YES'
  when c='N' Then Say 'NO'
  otherwise       Say 'Undecided'
  End 