/for loops need a variable?

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

/for loops need a variable?

Post by MrSmallie » Thu Apr 29, 2004 1:32 pm

Why can't I just do

Code: Select all

/for I 1 to 4
???
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 29, 2004 1:36 pm

You have to declare a variable and the /next it.

Code: Select all

/declare a int local

/for a 1 to 5
    /echo ${a}
/next a
If your question was more to "Why do we have to declare it, just assume it" I don't really see how one declare is a big deal to do.

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Thu Apr 29, 2004 1:38 pm

Because "I" is a variable, else how do you call an object which value change with the time?

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Thu Apr 29, 2004 1:40 pm

Bah..stupid me. Having brain overload.

I have a variable as the end #, and just assumed it was talking about that.

Thanks
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]