bcc
bcc copied to clipboard
Allow non-const values for Step
BlitzMax currently has a limitation that only allows for constant values for the Step
counter of a For
loop.
I don't see any reason why the following code shouldn't be allowed :
SuperStrict
Framework brl.standardio
Function loop(total:Int, steps:Int)
For Local i:Int = 0 Until total Step steps
Print i
Next
End Function
Much like how total
is evaluated once at the initialisation of the loop, I think we could easily apply the same logic to the Step
value, making it effectively constant for the iteration.