Loop counter doesn't reset
Posted: Fri Nov 12, 2010 2:22 pm
Hi
In making a project I found a little error (or at least I think it is...)
I had a loop that run 10 times and did certain checks while in the loop, one check could send the program to a connection just before the loop started, hence restarting the loop counting 10 loops again.... or so I thought.
If you send the program back from within the loop when it gets into the loop again it carries on from the count it got to before instead of starting to count 10 loops again.
I have attached a very much stripped down example just to show the point.
As you can see the program is sent to before the start of the loop (an infinate loop). But... the program doesn't do that, it counts the 10 loops and then exits the loop.
Regards
In making a project I found a little error (or at least I think it is...)
I had a loop that run 10 times and did certain checks while in the loop, one check could send the program to a connection just before the loop started, hence restarting the loop counting 10 loops again.... or so I thought.
If you send the program back from within the loop when it gets into the loop again it carries on from the count it got to before instead of starting to count 10 loops again.
I have attached a very much stripped down example just to show the point.
As you can see the program is sent to before the start of the loop (an infinate loop). But... the program doesn't do that, it counts the 10 loops and then exits the loop.
Regards