- Joined
- Apr 27, 2011
- Messages
- 272
Knowing that we cannot acces a local value type from a seperate thread if it is not returned or stored in a variable, how bout for local hashtables? (i tried this and it worked)
Just wondering if this is a bug or if it even has a use...
JASS:
library Box initializer Init
//===========================================================================
function Capsulate takes nothing returns hashtable
local hashtable capsule=InitHashtable()
call SaveInteger(capsule,0,1,1)
call SaveInteger(capsule,0,2,2)
call SaveInteger(capsule,0,3,3)
return capsule
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local hashtable capsule=Capsulate()
local integer a=LoadInteger(capsule,0,1)
local integer b=LoadInteger(capsule,0,2)
local integer c=LoadInteger(capsule,0,3)
call BJDebugMsg(I2S(a))
call BJDebugMsg(I2S(b))
call BJDebugMsg(I2S(c))
endfunction
//===========================================================================
endlibrary