|
-
Jun 15th, 2005, 11:07 PM
#23
Re: Doevents?
The worst thng about DoEvents is it can screw with your code execution. If you have events firing that depend on data handled by other events, placing a Doevents in one event can cause the other event to start executing. This sort of thing really messes up program flow.
This is because DoEvents allows *all* other code that is waiting to be exeucted, to run. Sleep on the other hand doesn't allow any code from your process to run, it merely pauses the process for the specified time and this allows other process to get the CPU control.
In a loop, Sleep is the best thing to allow other processes to run, however if you have things waiting in your own process then DoEvents is really the only way to go. (there are other APIs you can use but I've forgotten them ) Brucevde's code looks like a really way of using it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|