When using a For/Next Loop with the Step -x option (stepping backwards) if you set the To value using a variable and NOT hard-coded then you get a lockup if the variable = 0.
Example
dim indexPosition = var0
dim index = var1
indexPosition = 0 ;FAIL
;indexPosition = 1 ;OK
;indexPosition = 2 ;OK
for index = 2 to indexPosition step -1
next
;WORKS
;for index = 2 to 0 step -1
;next
MainLoop
BACKGRND = rand
goto MainLoop
I assume as the indexPosition value is not known at compile time this may be a limitation of the feature?