Link to home
Start Free TrialLog in
Avatar of gdrnec
gdrnecFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gdrnec

ASKER

Then my problem must be in the framework.
Thank you for your quick response.