

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.




 
#include <flow.h>
 
DEF-MAIN(argv, argc)
   BREAK-ON
   SET(c,0)
   WHILE (1)
       COND( KEY-PRESSED? )
            SCAN-CODE(c)
            BREAK-IF ( c ) IS-ESCAPE
       CEND
       PRNL( "CODE = ", c )
   WEND
   PRNL( "Last key pressed: ", c )
END
 