A For loop will go from a starting value to its end value with an increment of 1 each time it loops.
So:
For 0 to 5
(Will start at 0 and end at 5)
So 0,1,2,3,4,5
You can get the current index of a loop by using loopindex. This also means as C2 encounters a loop it will finish it before continuing. And guess that's why you think it jumps to the end, but in fact its running 5 times through the loop. So if you at the end of the loop have something that would be an end, then that is what it will be.
But when the loopindex is = 5 in the above example then the loop is done and C2 will continue with whatever.
In your example you would normally do like this:
Every 1 second
For 1 to Variablestorenumber
...do something
(Which means that every 1 sec you run a loop starting at 1 and end at "Variablestorenumber")
So its predictable in the sense that you might know the starting value and the end value, or at least based on some calculations know them and you know that it increment by 1 each time.