In a FOR loop, when the second parameter contains a value less than or equal to -1 and the third parameter contains an end value of -1, the loop does not stop when the end value reaches -1. It loops endlessly unless a stoploopif is present.
FOR x,-3,-1
message x
stoploopif x=2
endloop
For all other end values I have tested, like -3,-2, 0 and 1, for example, the loops stop as expected if the start value is less than or equal to the end value.
Negative numbers in the FOR loop allow use of a descending loop number to work from the highest index numbers of a list to the lowest, for example when importing the contents of a mail folder, the oldest (highest numbered) email first. This can be done otherwise with a different loop and more steps, but the FOR loop is most elegant.
I am using this technique in a few places and would like to continue.
(Of course, by adding a stoploopif x=-1 the FOR loop stops with an end number of -1.)