| View previous topic :: View next topic |
| Author |
Message |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Wed Jan 28, 2009 11:01 am Post subject: Modified Evloop |
|
|
Hi All
I've modified my Evloop...
| Code: |
:Evloop
rem flush the event buffer
while @event()
wait
wend
wait event
gosub @event()
goto evloop
|
Do I need the wait in the event flush? If I just use the
while loop will it run to fast to dump the unwanted events?
Thanks
David.M |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Jan 28, 2009 4:26 pm Post subject: |
|
|
Stupid question.. why are you needing to flush the events?
How do you know you aren't flushing events that you need? _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jan 28, 2009 9:56 pm Post subject: |
|
|
It might be easier to just test for the events you do want and need. My question is, how and why are you getting events that you need to dump?
To test for the events you want, do this:
| Code: | :EVENTLOOP
WAIT EVENT
%E = @event()
IF @equal(%E,CLOSE)
GOTO CLOSE
ELSIF @equal(%E,RESIZE)
GOTO RESIZE
ELSE
INFO "Here's an event you don't seem to have covered: "%E
END
GOTO EVENTLOOP |
If you use the if statements you can at least capture the events you want, and ignore any that you don't want. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|