

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 c:\cxpl\codes;  \intrinsic 'code' declarations
int K, N;
[N:= 0;
repeat  K:= KeyHit;     \counts up until a key is pressed
        IntOut(0, N);  ChOut(0, ^ );
        N:= N+1;
until   K;
]