TH> ==============================
TH> FOR x?? = 10 to 1 STEP -1
TH> ? x??
TH> NEXT
TH> ==============================
That example should give you an Error 6-- Overflow. If it is being
ignored, it sounds like you have the numeric error checking turned off.
In the IDE it is under the top menu, Options/Compiler/Error Tests.
It isn't the Word data type per se that is the problem in a FOR/NEXT
loop, it's combining it with STEP -1. You can demonstrate that with
FOR x?? = 1 to 10 STEP 1
? x??
NEXT
I think I recall that PB uses the data type of the variable to hold the
STEP amount. So it errors out when it tries to assign a negative value
to a word. Makes sense, I suppose; it's probably more efficient than
trying to subtract an integer from a word.
* RM 1.31 1209 * Anton Monroe 70304.3663@compuserve.com
--- FidoPCB v1.4 [ff013/c]
---------------
* Origin: Sound Advice - 24 Nodes (816)436-4516 (1:280/333)
|