Hello,
I am building a loop to do a certain action (calling an internet site) for each element in a list.
Since I don't know how long it takes to get the result I fire a timer and I process the action when the result is ready.
To do the action for the second item in the list I have to wait until it is ready.
I built various versions of for each loops:
- in one version I put a variable as the increment, starting this variable with 0. the variable is then put to 1 when the other (Asynchronous action) is done. and then inside the loop I put the variable back to 0.
it looks like we NEVER go inside the loop.
- in another version I intialized the increment variable to 1, and the variable is then put to 0 inside the loop. The loop does not "pause" and runs up to the end, as if the value of the increment is never changed.
So the question is, can we use a variable as increment in a for each loop?
second question, how can I run such a loop by "pausing" between the iterations, wthout going to building the loop myself step by step..
thanks,
Bernard