I have a for - Next Loop with a large chunk of code in it. Depending on the circumstance I either want the Step value to be 1 or 3, but Step is a constant so I can't set it to a variable. I don't want to repeat all the code, so was wondering if there is a way to set the step value according to my circumstance, or whether I need to use a different type of loop.
Conditional Steps
BlitzMax Forums/BlitzMax Beginners Area/Conditional Steps Hello.
1) Use an If-Then and have two separate loops.
2) Don't use a for-next, use a while-wend/repeat-until and set the step yourself.
Goodbye.
1) Use an If-Then and have two separate loops.
2) Don't use a for-next, use a while-wend/repeat-until and set the step yourself.
Goodbye.
Yep - thanks guys, I changed it to use a While loop and set the step myself.