Reset for loop index inside block

Is there any reason why I can't reset the for loop index inside the loop?
I have a piece of code that does not behave and I can only come up with that reason.

What I want to do is:
for (var i=0;i<resultSet.rowCount();i++) {
   if (some condition) {
       i = i + 4; // skip over the next four rows

Is there any reason to believe that the above would not work?
Who is Participating?
Chris StanyonCommented:
That's absolute fine. You can change the value of $i inside the loop without problem
gdrnecAuthor Commented:
Then my problem must be in the framework.
Thank you for your quick response.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.