VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Better Than VB DoEvents

Steve H. Miller  (1 Submission)   VB function enhancement   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

Doevents in VB utilizes a lot of Windows resources. Use it in a Do-While loop and watch the resource meter on your computer go over the edge! This code I call 'Wait' eleviates this resource intesive task and allows Windows to do it's timeslicing to handle other events.

Inputs
To use it, simply cut-and-paste the code into a module (.BAS) and make a call to the 'Wait' event as such: Call Wait 5 ' Wait for 5 seconds

Assumes
Just plop the whole thing into a .BAS module and call the function passing the number of seconds as a parameter to wait.

Returns
Returns nothing.

Side Effects
Reduced resource usage!

Rate Better Than VB DoEvents (7(7 Vote))
Better Than VB DoEvents.bas

Better Than VB DoEvents Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters