forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Modified Evloop

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Wed Jan 28, 2009 11:01 am    Post subject: Modified Evloop Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Wed Jan 28, 2009 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jan 28, 2009 9:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group