HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Boolexprs and Structs

07-13-2007, 09:32 PM#1
Joker
How are do you use boolexprs with structs? Do you have to pass the struct over to the boolexpr function or is there another way?
07-13-2007, 10:49 PM#2
DioD
function or code type cannot be stored inside array.
structs is just global arrays.

again and again peoples think that structs is some thing different.
07-13-2007, 10:51 PM#3
Vexorian
Quote:
Originally Posted by DioD
function or code type cannot be stored inside array.
structs is just global arrays.

again and again peoples think that structs is some thing different.
boolexprs are handles, it is all possible to have them as arrays.

Although I think that would be pretty much useless.
07-14-2007, 08:22 PM#4
Joker
I was thinking if there was a way to pass it in a situation like this:
Collapse JASS:
function bxpr takes nothing returns boolean
    IsUnitEnemy( GetFilterUnit(), GetOwningPlayer(**Unit**) ) == true
endfunction

function a takes nothing returns nothing
    //Say I was using struct on this func
    local group g = CreateGroup()
    call GroupEnumUnitsInRange( g, 0,0, 200, Condition( function bxpr ) )
   ...
endfunction
07-14-2007, 08:39 PM#5
grim001
Use a temp global.
07-14-2007, 09:21 PM#6
Joker
temp = temporarily?
whats a temp global?
07-14-2007, 09:27 PM#7
Captain Griffen
A global that you use only for an instant to transfer stuff between threads.
07-14-2007, 10:50 PM#8
Toadcop
like that
Collapse JASS:
[b]globals
    unit tmp_unt=null
endglobals[/b]

function bxpr takes nothing returns boolean
    IsUnitEnemy( GetFilterUnit(), GetOwningPlayer([b]tmp_unt[/b]) ) == true
endfunction

function a takes nothing returns nothing
    //Say I was using struct on this func
    local group g = CreateGroup()
    [b]set tmp_unt=Your_Unit[/b]
    call GroupEnumUnitsInRange( g, 0,0, 200, Condition( function bxpr ) )
   ...
endfunction