Call vs Send
Richard Gaskin
ambassador at fourthworld.com
Thu Jun 9 21:23:55 EDT 2005
Dennis Brown wrote:
> Richard,
>
> Going through your tutorial is what made me try to improve my scripts
> with call. I thought that the call would execute a script in another
> place but keep the context of where it was called from. So 'me' would
> be the field that the call originated from and not the card that the
> script was in. But after a test, it looks like that is not the case
> --too bad.
Does "send" do what you need?
> It is the target that returns the name of my field, but the
> group name is left off which is bad for me because I have the same name
> repeated in many differently named groups. I have groups of fields and
> buttons that are created from templates on the fly, along with many
> saved values for each (in custom properties). These are related to
> various setup conditions for running simulations. I obviously want the
> minimum scripts in the duplicates, and most of the script in a common
> place where changes are manageable. Perhaps you should be prepared to
> make sure nobody else makes this mistake in your tutorial.
Using "the long id of the target" will provide an absolute reference to
the specific object, but I'm not sure why simply "the target" doesn't
return the same value. Hmmm.... makes "the target" rather less useful,
unless there's a benefit to the truncated descriptor it returns that I'm
just not seeing.
But to be honest, it's very rare that I use either "call" or "send".
Both are up there with "do" in terms of a modest amount of additional
overhead needed to handle them relative to calls natively in the message
path.
Could there be another way to handle that using the native message path,
maybe a common handler in the master group or card script?
Also, what sort of simulation are you working on?
--
Richard Gaskin
Fourth World Media Corporation
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list