There seems to be an issue with using FOR/NEXT loops. I discovered it while rewriting my card game and while working on another app. When I use a FOR loop it doesn't work properly as illustrated in the code below. On my machine it gets stuck in a loop, when it should only go through it 10 times. This is related to a bigger issue of variables becoming corrupt. If I change the code below to use a WHILE/WEND it works as it should. I'm using version 1.670 of EB on Vista Home.
$MAIN
AUTODEFINE "OFF"
DEF Count,i:INT
OPENCONSOLE
Test()
PRINT Count
DO:UNTIL INKEY$ <> ""
CLOSECONSOLE
SUB Test
Count=10
FOR i = 1 TO Count
PRINT "Here"
NEXT Count
ENDSUB
Because you have an error ;)
FOR i = 1 TO Count
PRINT "Here"
NEXT Count
Should be:
NEXT i
Oops! Sorry about that Paul. That's what I get for not programming in years and then going back and looking at 3000 lines of code.
Thanks for pointing out the error of my ways. :)