ARRAY TO CONTROL 3 STEPPER MOTORS

What does that code do exactly? There are so many things wrong with that code to even know where to begin. But, in general, using the same variable for the index for the inner loop as the outer loop really is NOT a good idea.

The middle clause is a while clause. The loop runs while the middle clause is true. WTF is the purpose of the outer loop? Exactly how many times will it iterate?