NXC Version 1.2.1 r5
Another kind of loop is the for loop.
This type of loop allows automatic initialization and incrmementation of a counter variable. It uses the syntax shown below.
A for loop always executes statement1, and then it repeatedly checks the condition. While the condition remains true, it executes the body followed by statement2. The for loop is equivalent to the code shown below.
Frequently, statement1 sets a loop counter variable to its starting value. The condition is generally a relational statement that checks the counter variable against a termination value, and statement2 increments or decrements the counter value.
Here is an example of how to use the for loop: