HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Integer A, local or not?

02-04-2005, 11:21 AM#1
wiebbe
what i have been wondering for sometime now is this:

Ive use a couple of loops in my map, including some For each Integer A loops.
Not i noticed a bug, when using a wait in one of the loops, the loop suddenly jumped from 1 to 6 and didnt go through 2-5..

I actually cracked my brains over this error, i couldnt find out why it didnt work, then suddenly it hit me, perhaps its the Integer A?

i used diferent variable instead of the Integer A i used TempVar(Playernumber) and the trigger worked flawlessly..

Now why isnt the Integer A standard a Local var? Because to me it doesnt look like one:
Code:
        set bj_forLoopAIndex = 1
        set bj_forLoopAIndexEnd = 10

so can someone confirm this, the variable Interger A isnt a Local one?
02-04-2005, 12:44 PM#2
Elven Ronin
I don't know for sure, but it must be global if it happens that way. I wouldn't be too sure on that, i rarely need "wait" actions in my triggers. Seems like less hassel that way.
02-04-2005, 04:44 PM#3
iNfraNe
yea, it is obviously a global. Why they didnt use locals? simple, they would have 2 add code on the top of the function while there was no need ^_^. Blizzard lazy ;) they use globals for all :P
02-04-2005, 04:46 PM#4
Vexorian
It is a global variable, if you check at the function it is not declared on the function, and GUI uses another function to return it, so it cannot be a local.

It is a global variable declared at blizzard.j , and it is a global because of:
a) Blizzard's lazyness
b) Pick Every --- , Conditions of if the else statements and the such use other functions, so using a local integer A wouldn't work.
02-04-2005, 04:47 PM#5
Tommi
For Loop Integer A is a global variable called bj_forLoopAIndex. The whole bunch of ForLoop integers are the following (all global):

// Utility function vars
integer bj_forLoopAIndex = 0
integer bj_forLoopBIndex = 0
integer bj_forLoopAIndexEnd = 0
integer bj_forLoopBIndexEnd = 0

(From Blizzard.j)