MissouriTiger
Programmer
This is really strange. My program is essentially a loop, whose terminating condition is a boolean flag called blnPause which is set to true when the user clicks 'Pause'. It runs either until it finds something it is looking for, or until the user clicks either the 'Pause' or 'Exit' button.
But the thing runs so fast that the click events for the buttons go unnoticed. So I added DoEvents and a timer, which shuts itself off after one half second, and use the following loop to fire DoEvents and to check when the timer is done:
objPauseTimer.Enabled = True 'Timer will turn itself off
Do Until pauseTimerDone
DoEvents
Loop
pauseTimerDone = False 'Reset
This still isn't enough. What should I do? Should I make the timer run longer? Maybe a full second? Maybe 2 seconds? Maybe an hour? I mean, how can I be certain what time frame is going to be sufficient?
Isn't there a way to just ask the system if there are any events and use the answer to that request as the terminal condition of a loop? Something along the line of this:
Do Until MyProgram.HasEventsInQue = false
DoEvents
Loop
Any suggestions would be much appreciated.
Greg Norris
Software Developer
________________________________________________
Constructed from 100% recycled electrons.
But the thing runs so fast that the click events for the buttons go unnoticed. So I added DoEvents and a timer, which shuts itself off after one half second, and use the following loop to fire DoEvents and to check when the timer is done:
objPauseTimer.Enabled = True 'Timer will turn itself off
Do Until pauseTimerDone
DoEvents
Loop
pauseTimerDone = False 'Reset
This still isn't enough. What should I do? Should I make the timer run longer? Maybe a full second? Maybe 2 seconds? Maybe an hour? I mean, how can I be certain what time frame is going to be sufficient?
Isn't there a way to just ask the system if there are any events and use the answer to that request as the terminal condition of a loop? Something along the line of this:
Do Until MyProgram.HasEventsInQue = false
DoEvents
Loop
Any suggestions would be much appreciated.
Greg Norris
Software Developer
________________________________________________
Constructed from 100% recycled electrons.