View Single Post
  #9  
Old 06-10-2005, 11:03 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
I said it to him; I told him that it is supposedly slower, because I recalled somebody else telling me that. I did not know if (or why) it was true or not. Sorry for the confusion

Anyway, this was discussed on #gscript on IRC for a little while. Here's a log:


<CheeToS> there is some confusion about using the variable "i" in for loops
<Jacco> There is?
<fry> there always is confusion
<VeloxCruentus> i = global var. They conflict with other NPCs.
<CheeToS> some say you should use this.i to avoid conflicts
<Rick> VeloxCruentus: four years ago
<fry> yep, non this. vars don't even work in gani scripts
<Bennity> How did the variable i come along anyway
<Bennity> It seems to be used for temp things
<Rick> iterator
<fry> it's small
<Jacco> integer?
<Jacco> oh.
<fry> and that
<Bennity> ah
<CheeToS> what is your opinion, Rick?
<Bennity> I thought it stood for something
<Rick> my opinion is to use temp.i
<CheeToS> lol
<fry> same here
<CheeToS> without GS2
<Bennity> In fact, there is a thread on the Graal forums from months and months ago about the use of i
<Rick> still, temp.i
<Bennity> and what it means
<Jacco> there's a temp.i?
<Jacco> I think all single-letter variables should be declared temp.
<ben> this.i only if sleep in loop.
<ben> kai smacks you if sleep in loop.
<ben> -> no this.i
<Jacco> lol
<Jacco> I sleep in the loop.
<ben> CheeToS: How else is it going to get screwed up?
<ben> Hm. Perhaps if you call a function that also modifies i.
<ben> temp.i wins I suppose.
<fry> other scripts using i at the same time
<Rick> ben: aye
<CheeToS> velox says he has had problems with other level NPCs changing i
<ben> Rick: Is temp.i local to the stack frame?
<fry> but that's not possible so wooh
Reply With Quote