VB how to realize continuous query condition are satisfied
Time:10-23
Deep haunts me, there is a problem,, but I am a novice, not done similar project, so, have to come to CSDN,,
I want to realize this function: in a process, when to meet certain conditions, I will perform a piece of code, judgment conditions, there are two, three or more, after thinking, check I came up with several programs: the following
1. Use a timer, whether conditions to meet Private Sub Timer1_Timer ()
If condition 1=True And condition 2=True And 3=True Then . Execute the code.. End the If
End Sub
2. Write your own an infinite loop Public Sub power () Dim Condition As Boolean Condition=True 'has set itself a loop Condition Do the While Condition=True 'unceasing cycle to judge whether meet the conditions, once meet Condition is executed I think code
If condition 1=True And condition 2=True And 3=True Then . Execute the code.. End the If
Loop End Sub
But I found that programming, using the above two methods will make the program died, the other CPU utilization rate up to 50%. Don't know is there any other way, to keep circulation judgment conditions are met, as soon as conditions meet the requirements of I, is executed to code!!!!