For loop incrementing pattern HELP
I have a really urgent need of assistance. I'm absolutely stuck on this...
Is there anyway to make a for-loop increment by 1 the first run, and then by 6 then next run, then 1, then 6, and so on.
ex: (increment 1, increment 6, increment 1, increment 6, ...)
Or if someone could point me in the right direction I'd really appreciate it.
Thank you much.
Sure this is possible, in a variety of ways.
Basically you'll need to use a boolean variable in order to turn on and off when you want to add by six and when you want to add by one.
So if you want to increment by six, just add five to your variable.
If you want to add by one, don't add anything.
Another alternative is to use the last parameter in the for loop to do the switching of the boolean variable.
In any case, hope that helps without actually doing the assignment for you!
|All times are GMT +1. The time now is 12:00 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.