How do I make the Loop to check a Variable every 1 second?
Hello, I need to make a while loop that checks a global Variable every 1 second. I tried to make it with No time limit, but it make the system crash,May be because it is an infinte loop.
thanks,
here is the code:
While Loop_Working
If Global_Flag = True Then
Loop_Working = False
GoTo Handle_Second_One
End If
Wend
Eli
Re: How do I make the Loop to check a Variable every 1 second?
Re: How do I make the Loop to check a Variable every 1 second?
Because Visual basic only operates on a single execution thread, the code that you want to set the global flag can never be set.
You could include a DoEvents in the loop such that whatever event sets the global variable may fire.
HTH,
D
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com