[quote=404749:@Alexandre Cunha]Well when XOJO told me that an infinite loop on a for / next (downto from 3 to 0) it’s normal to keep looping forever
You can expect anything from XOJO![/quote]
This could happen if the data type doesn’t have values less than 0:
This will work:
For i As Int8 = 3 DownTo 0
Next i
This will be a infinite loop (because there are no values below 0):
For i As UInt8 = 3 DownTo 0
Next i
For - next, needs a value below 0 (when using DownTo) to finish execution. If you need to use a data type with no values below 0, then you can’t use For - next or you will get an infinite loop. You can use one of the related options, maybe do - loop or while - wend.
Edit: if you want to use for - next and datatype that lowest value is 0, you can add this line just before the next i:
if i = 0 then exit
that will avoid the infinite loop