gdrnec
asked on
Reset for loop index inside block
Experts,
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?
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()
if (some condition) {
i = i + 4; // skip over the next four rows
}
}
Is there any reason to believe that the above would not work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for your quick response.