Loop until keyboard press

Hi there,

Is there a way to stay in a loop until a key on the keyboard is pressed? Something like this...

Keypressed = false

while Keypressed = false do this.
  Do stuff here....
  Do stuff here....
  Do stuff here....
wend

Then somewhere else there is code which catches keypressed..
If keyboard space bar is pressed
Keypressed = true
This will stop the loop.

Thanks!

Parents Reply Children
No Data