I hate the handle Vars, I wanted to make it usable for everybody.
Probably i submit a advanced Version of the Handle Vars, probably.
Probably i submit a advanced Version of the Handle Vars, probably.
constant function WhichItemType takes nothing returns integer
return 'XXXX'
endfunction
function CountItem takes nothing returns nothing
set bj_forLoopAIndex=bj_forLoopAIndex+1
endfunction
function IsItemType takes nothing returns boolean
return GetItemTypeId(GetFilterItem())==WhichItemType()
endfunction
function CountFolianteInRect takes rect r returns integer
local integer n
set bj_forLoopAIndex=0
call EnumItemsInRect(r,Condition(function IsItemType),function CountItem)
set n=bj_forLoopAIndex
return n
endfunction