- Joined
- Jun 12, 2016
- Messages
- 11
I'm learning struct chapter from JassHelper Manual but it doesn't display any results nor answers and keeps show up some errors. This is too much annoying for me--
this code has error like:
I think there is no pair_sum function in the code when I after upload this thread.
Then, Where do I put that pair_sum function?
JASS:
struct pairpair
pair x=0
pair y=0
endstruct
function testpairs takes nothing returns nothing
local pairpair A=pairpair.create()
local pair x
set A.x = pair.create()
set A.y = pair.create()
set x=A.y
set A.y= pair_sum(A.x,A.y)
call BJDebugMsg(I2S( A.y.x )+" : "+I2S( A.y.y ))
call A.x.destroy()
call A.y.destroy()
call A.destroy()
call x.destroy()
endfunction
function Init_struct takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t, 2)
call TriggerAddAction(t, function testpairs)
endfunction
this code has error like:
I think there is no pair_sum function in the code when I after upload this thread.
JASS:
function pair_sum takes pair A, pair B returns pair
local pair C=pair.create()
set C.x=A.x+B.x
set C.y=A.y+B.y
return C
endfunction
Then, Where do I put that pair_sum function?
Last edited: