By the way, your code should have been organized like this:
But I believe the reason it doesn't work, is because KeyHit and KeyDown are intended to be used in a 'graphical' app (meaning using the Graphics command).
So either use the Graphics command, or you will have to use something like Input, GetKey, or WaitKey.
Print("press esc 5 times to quit!") eschits=5 While(eschits) If KeyHit(1) eschits=eschits-1 Print "Esc Hit" EndIf Wend End(You were missing an EndIf, and the 'If eschits=0' line was unnecessary)
But I believe the reason it doesn't work, is because KeyHit and KeyDown are intended to be used in a 'graphical' app (meaning using the Graphics command).
So either use the Graphics command, or you will have to use something like Input, GetKey, or WaitKey.