

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.




import: console
 
: checkKey 
| key |
   System.Console receiveTimeout(2000000) ->key   // Wait a key pressed for 2 seconds
   key ifNotNull: [ System.Out "Key pressed : " << key << cr ]
   "Done" println ; 