Code: Select all
Option TargetCPU zx1280n
Sub Main()
dim Index as integer
const minIndex as integer = -1, maxIndex as integer = 1
debug.print "Begin Loop"
for Index = minIndex to maxIndex
debug.print "Inside Loop"
next
debug.print "Done with Loop"
End Sub
Code: Select all
ZBasic v2.5.5
Begin Loop
Done with Loop
Based on the documentation, it seems that a negative minIndex should work, although in this case the loop never executes.
It would seem that negative integers are not supported, but
Code: Select all
const minIndex as integer = -3, maxIndex as integer = -1
Code: Select all
ZBasic v2.5.5
Begin Loop
Inside Loop
Inside Loop
Inside Loop
Done with Loop