Page 1 of 1

for next loops

Posted: Wed May 19, 2004 11:49 pm
by EQBot_man
Why doesn't this work?
I get /for loop using invalid variable.
I know its so simple but for the life of me its beyond my grasp.

----------------------------------------------

#turbo
/delay 0

Sub Main
:Continue

/for Loop 0 to ${Group}

/echo test

/next Loop

/goto :Continue
/return

-----------------------------------------------

Posted: Wed May 19, 2004 11:52 pm
by Jerle69
You have to delcare all variables you wish to use, including loop indexes.

Insert:

Code: Select all

/declare Loop int

...somewhere before your /for statement, and you're good to go.

As a sidenote, you don't need #turbo or the /delay command; they're not doing anything worthy for you here.