Interrupt loop operation
-
How can i interrupt a loop operation? Example im iterating over all the records of a 100,000 datareader however i decided to cut short the iteration by clicking a Stop button. How do i do that?
-
How can i interrupt a loop operation? Example im iterating over all the records of a 100,000 datareader however i decided to cut short the iteration by clicking a Stop button. How do i do that?
you can set a temp var dim tmp as boolean when you press the button set it to true in the while code use this while tmp = true ... end while
-
How can i interrupt a loop operation? Example im iterating over all the records of a 100,000 datareader however i decided to cut short the iteration by clicking a Stop button. How do i do that?
You add a variable that you check within the loop. Exapmle:
dim b as boolean as boolean dim i as long for i=0 to i=1000 if b=true then exit for end if next i
you change the value of b somewhere else in your code, probably in the "Stop" Button event. You may also want to consider concurrency issues on that variable. Good Luck.