

Determine if a key has been pressed and store this in a variable.

If no key has been pressed, the program should continue without waiting.




procedure main()
   delay(1000)                              # give user a chance to input
   if kbhit() then                          # test for input
      write("You entered ",x := getch())    # read w/o echo
   else                                     # use getche for echo
      write("No input waiting")
end