1. Hanging reproduced here, latest TSE for Microsoft Windows version 4.50.19
2. According to the documenation this syntax should be valid in TSE:
The "for" statement syntax is:
for integer_variable = numeric_expression to/downto
numeric_expresssion2 [by numeric_expression3]
statements
endfor
Specify "to" or "downto" to indicate whether the value of numeric_expression
is to be incremented ("to") or decremented ("downto") until it reaches
(inclusive) the value of numeric_expression2. The value will be
incremented/decremented by 1, unless you specify an alternate "by"
numeric_expression3 value.
3. Possible root cause:
I assume what happens is that this '-1' simply is converted to
-( -1 ) internally, thus +1, so starting from 66 it simply should continue
to add until it reaches MAXINT (=2^31 - 1)
a large number.
The 32 bits of TSE integer numbers are in general
split in 2^31 - 1 positive numbers, 2^31 negative
numbers and a zero.
4. Reaching that value takes a long waiting time assumed, so it appears
to the outside world viewer that TSE is hanging.
To check that hypothesis, running this program should quickly stop:
PROC Main()
INTEGER ii
for ii = 66 downto 1 by -1000000
endfor
Warn( ii )
END
This stops very quickly and shows -214697230
which is close to -MAXINT or thus -( 2^32 - 1),
thus the maximum negative number in TSE.
5. Conclusion: From the last example: If negative numbers like -1 used in 'by' it counts
down in the direction of the negative numbers.
So I believe formally it should stop at 1, when it starts at the larger number 66.
with friendly greetings
Knud van Eeden