On the subject of things with the same short name... ('identical' groups which behave differently)

Bob Sneidar bobsneidar at iotecdigital.com
Fri Oct 8 11:29:37 EDT 2021


Even better, use the long id of me to precicely identify the object. There are occassions where the stack you think is the topstack, isn't. 

Bob S


> On Oct 8, 2021, at 04:16 , David V Glasgow via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Ah! (light comes on).  Thanks Sean.  So ‘me’ is actually more specific than it would seem!  I avoided ‘me' because it returns the short name of an object (of which there are several), and went for the long name of me because it is unique.  
> 
> Just to be clear, what you are saying is that when LC searches for ‘me’, the first one found will always be the target, and the search stops there.
> 
> I still don’t understand why rect (the rect of the long name of me) works in one but fails in another group, though.
> 
> Cheers,
> 
> David G
> 
>> On 8 Oct 2021, at 10:58 am, Sean Cole (Pi) via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> The message path looks for the first instance it finds with a given name.
>> As your script is within the group itself, it would be easier (lazier ;) )
>> to reference to each group as 'me'
>> eg
>> lock screen for visual effect in rect (the rect of me)
>> 
>> rather than 'the rect of the long name of me'
>> 
>> Sean
>> 
>> On Fri, 8 Oct 2021 at 10:32, David Glasgow via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>> 
>>> Being essentially a lazy and a sloppy programmer, I made a group which
>>> contained a script that caused the group to do what I wanted.  Then I
>>> copied it again and again, and grouped the resultant groups.   Rather than
>>> adapting the script to be located on the card I just left several identical
>>> scripts in groups which have the same short name.  I told you.  Lazy.
>>> However, all groups worked absolutely fine.
>>> 
>>> I then decided to add a visual effect to the final unlock screen in each
>>> instance.  I tried a couple of groups to see how it would look, and I found
>>> that it worked perfectly on one group, but not a second, identical(?)
>>> group.
>>> 
>>> The script is...
>>> +++++++++++
>>> 
>>> on mouseup
>>> 
>>> lock screen for visual effect in rect (the rect of the long name of me)
>>> 
>>> **depending on target object which was clicked, change appearance of group
>>> here**
>>> 
>>> unlock screen with visual wipe right slow
>>> 
>>> end mouseup
>>> 
>>> +++++++++++
>>> 
>>> There are no other locks or unlocks.
>>> 
>>> The weird thing is that the script runs without error in both cases.  The
>>> final appearance of the group in both cases is exactly what I would
>>> expect.  However, the visual effect manifests itself in one instance, but
>>> not the other.  I was bit hesitant about 'the rect of the long name of me’,
>>> but as I keep saying, it seems to works perfectly in one case.
>>> 
>>> Que pasa?
>>> 
>>> (  Mac 10.13.6 and LC 9.6, if that makes a difference.)
>>> 
>>> Best Wishes,
>>> 
>>> David Glasgow
>>> Consultant Forensic & Clinical Psychologist
>>> Carlton Glasgow Partnership
>>> Director, Child & Family Training, York
>>> Honorary Professor, Nottingham Trent University (SOCAMRU)
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list