Step is something that delphi kinda overlooked.
Easiest answer is a while loop.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
most languages dont like you messing with the itterator. You would do better to use a while loop.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
FlamingClaw,
Two thoughts on your example:
1.) i := i + 9; // does not increment by 10
2.) Using the For statement could easily lead to an error in a large body of code. Imagine coming back to this a year from with no memery of the logic. You would see the For statement and assume an increment of 1 with the For statement controling the i variable. It would be better to use a With or Repeat statement because you would still seek out the increment line to evaluate the step size.
jsosnowski
Junior Poster in Training
68 posts since Nov 2007
Reputation Points: 11
Solved Threads: 11
FlamingClaw,
My bad, you are right.
However, overiding the automatic increment still looks like a bad practice.
jsosnowski
Junior Poster in Training
68 posts since Nov 2007
Reputation Points: 11
Solved Threads: 11