[Gambas-user] Waiting for keystrokes in a console
Rolf-Werner Eilert
eilert-sprachen at ...221...
Fri May 7 11:03:48 CEST 2010
When I am in a console application, I merely have a
PUBLIC SUB Main()
END
which will once go through and stop. So I guess when the program has to
wait for the user to press a key, I would have to monitor keystrokes
like in good old BASIC times such as
while not instat(): wend
a$ = keystr$
(Was it keystr, or what? Don't remember, it was something like that... :-) )
In Gambas, there is no instat() and stuff, so I thought maybe I can do
that with something like
PUBLIC SUB MMain_KeyPress()
END
But when would this be activated? It wouldn't actually wait for a
keystroke but Main would just run through and quit.
I know there is the Console example, but it requires a bash opened
background and catching its events via Process and so on - isn't that a
bit too much?
You see, I don't get on with this. Probably I'm watching the problem
from the wrong direction ;-) so thanks for your help.
Regards
Rolf
More information about the User
mailing list