calling a remote function..
David Bovill
david at openpartnership.net
Sat Jan 20 09:51:41 EST 2007
Chipp I have been using "send" and command and function calls for several
years now - like Andre I do not use "functions" but send "commands" - even
better in my opinion is to use getprop and setprop handlers - in your case
that would look like this:
put "1,000" into line 1 of marshalledData
put "Soldiers" into line 1 of marshalledData
-- get value("foo(param1,param2)",btn "bar")
get the foo [marshalledData] of btn "bar"
Where instead of a function the btn contains:
getprop foo [marshalledData]
put line 1 of marshalledData into param1
put line 1 of marshalledData into param2
return param1 &cr& param2
end foo
Now what would be great would be if you could use arrays to marshall the
data, but unfortunately arrays cannot be passed as params
on mouseUp pMouseBtnNum
put "1,000" into dataArray["num"]
put "soldiers" into dataArray["name"]
put the foo [dataArray] of btn "bar"
pass mouseUp
end mouseUp
getprop foo [dataArray]
put dataArray["num"] into param1
put dataArray["name"] into param2
return param1 &cr& param2
end foo
This would ore than overcome the limitation of 1 param + rev control passed
to the called object (2 param2 + rev control for setprops).
More information about the use-livecode
mailing list