| 03-20-2004, 05:52 AM | #1 |
Can someone help me, I have been trying to pass my local unit variable "hero" from one function to the next function, how would I do this without using globals? |
| 03-20-2004, 07:09 AM | #2 |
Depends on how you are calling the function. If it is a normal call, you do like this: Code:
function Foo takes integer a returns nothing
// Do something with the local integer 'a'
endfunction
function Bar takes nothing returns nothing
local integer a = 15
call Foo(a) // Pass it as a parameter
endfunctionHowever, if you are using it as a callback in a ForGroup for example, you cannot use parameters. In that case you must either use globals or the gamecache. |
| 03-20-2004, 08:59 AM | #3 | |
Quote:
|
