HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

booleanexpr with locals?

04-21-2004, 03:18 AM#1
-={tWiStÄr}=-
is it possible? im trying to do a GetBooleanAnd function, but im using locals. The way the converted GUI sets it up is with 3 diffrent functions. but im using locals, and ive been told all locals can only work in the function theyre defined in. Ive also been told Booleanexpr have to use 2 functions so what do i do without using globals?
04-21-2004, 03:53 AM#2
Narwanza
What kind of locals? The short answer is no. But if you are using units, then use GetFilterUnit(). That is most likely the only one you would ever need to use a boolexpr on. Post the code if that doesn't help. Why not just use the keyword and?
04-21-2004, 01:24 PM#3
-={tWiStÄr}=-
And works? I tried... but it was just errors waiting to happen, and everything was all screwed up, so ill try it again. and the locals are 2 integers.
I got a question tho... would you do it like this:
And((blahblahblah),(blah2blah2))
or this how iwould think it would be..
And(blahblahblah, blah2blah2blah2)
Thanks
04-21-2004, 03:25 PM#4
Narwanza
Oh, you don't need boolexpr on integers. Just do something like this.

Code:
function blah takes nothing returns nothing
    local integer i = GetRandomInt(-1000,1000)
    local integer x = GetRandomInt(-1000,1000)
    if (i < 0) and (x > 0) then
        call DoNothing()
    elseif (i > 0) and (x < 0) then
        call DoNothing()
    endif
endfunction

I hope that explains what I mean.
04-21-2004, 09:23 PM#5
-={tWiStÄr}=-
ok.. i tried something like that... but i mean i whipped it up real quick so prolly lots of errors. ill go try it now.

edit: yeah, it worked thanks :D