
-----------------------------------
nflavour
Thu Jan 08, 2009 10:27 pm

Complex button + procedure question
-----------------------------------
I have a few body procedures. and all of them uses the same button procedure (GUI.CreateButton). And since CreateButton requires a procedure when it's click, so i created one. That procedure should do the following:
add the price total based on the BODY procedure its in
and add the number of items based on the BODY procedure its in

Since the Createbutton procedure doesn't accept with procedures parameters. So I was wondering how do I make a button work in this case?
i am just stuck here..
i thought of this 
var total,totalnum:int:=0
%procedure
procedure simple (price,num)
     total+=num*price
     totalnum+=num
end simpe
%button procedure
procedure buttons(price,num)    
     var buttton1 := GUI.CreateButton (0,0,20, "button1", simple(price,num)) %