Using Step with non-constant variable

BlitzMax Forums/BlitzMax Programming/Using Step with non-constant variable

I want to use the code: For I:Int = 0 To MaxNum:Int Step XInterval but I get the error that step expression must be a constant. Is there a way I can use a Global variable for a step expression?

The step value must be a constant. Use a While loop instead.

I = 0
While I <= MaxNum
   ' do something
   I :+ XInterval
Wend

You would need to test I >= MinNum if the step value is negative.