Should "dispatch" be extended for timers?
Peter M. Brigham
pmbrig at gmail.com
Fri Aug 29 13:52:06 EDT 2014
On Aug 29, 2014, at 11:43 AM, Peter Haworth wrote:
> One other question regarding send. You can "dispatch function" - is there
> a way to send a message to a function and get hold of the result (obviously
> without a time specified)?
Look at the "call" command. This works for commands contained in the scripts of other objects, and I thought you could use if for functions too, but as I just experimented with it, I can't get that to work. However, you can do this:
put the following into the script of fld "text":
on testFn x
return x^2 + 1
end testFn
Then in the script of some other object you can:
call "testFn 3" of fld "test"
put the result
And you will indeed get "10" in the message box.
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
More information about the use-livecode
mailing list