On the subject of things with the same short name... ('identical' groups which behave differently)
David V Glasgow
dvglasgow at gmail.com
Fri Oct 8 07:16:29 EDT 2021
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.
> 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'
> lock screen for visual effect in rect (the rect of me)
> rather than 'the rect of the long name of me'
> 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(?)
>> 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
>> 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:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode