Call vs Send

Dick Kriesel dick.kriesel at mail.com
Wed Jun 8 17:16:19 EDT 2005


Dennis --

You can find the name of the group that contains the target in "the long
name of the target."

-- Dick


On 6/8/05 2:03 PM, "Dennis Brown" <see3d at writeme.com> wrote:

> Dar,
> 
> Yes, you see my problem exactly.  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.
> 
> I am already using a script that pass the name and group to the
> handler, but I wanted to make it even simpler and just call the
> routine without generating a parameter to pass.
> 
> Thanks,
> Dennis
> 
> 
> On Jun 8, 2005, at 4:33 PM, Dar Scott wrote:
> 
>> 
>> On Jun 8, 2005, at 1:54 PM, Dennis Brown wrote:
>> 
>> 
>>> I have two versions of a script.  The first uses an implicit send
>>> and works.  The second uses a call and does not work.  I was
>>> trying to simplify and expand my scripting abilities with call,
>>> but I must be missing something, because I can't see what is wrong
>>> with it.  I appreciate any insights.
>>> 
>> 
>> There are some differences between the 1) "implicit send" or
>> invocation and 2) send & call.  There are also differences between
>> send and call.
>> 
>> They might not apply to this particular case, but they might to
>> some things you might try.
>> 
>> The 'me' refers to the object that holds the script.  An
>> alternative you can use is 'the target' which is the name of the
>> object that the original (top level) message was sent to.  That is
>> changed on a send or call.
>> 
>> A send or call can have parameters.
>> 
>> In your case you might be able to use 'the target' unless it runs
>> into ambiguity problems.
>> 
>> You might be better off passing 'the id of me' and letting the
>> support function get what it needs from that.  Like this:
>> 
>>    saveMeTxt the long id of me
>> 
>> Unfortunately, 'the target' is suitable in only well controlled
>> cases.  It might not uniquely identify the target.
>> 
>> (There is also an unsupported way.)
>> 
>> dar
>> 
>> -- 
>> **********************************************
>>     DSC (Dar Scott Consulting & Dar's Lab)
>>     http://www.swcp.com/dsc/
>>     Programming and software
>> **********************************************
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list