Bug getting group name, plse check
prothero at earthednet.org
Sat Aug 15 01:56:46 CEST 2015
“the long name of me” is a complete reference to an object, which contains the group name. What I was trying to do is get the name of the group that the button is in. I can parse it from the long name of me, but thought it would pull it out of “me”.
Anyway, what do I know? If I’m wrong to expect this, then I won’t report it as a bug (of course).
Or perhaps there is a better way of getting the group that a control is within.
> On Aug 14, 2015, at 4:15 PM, Alex Tweedly <alex at tweedly.net> wrote:
> Is it valid to say (in the mouseUp script)
> ..... of grp me into ....
> Isn't 'me' a button, so "grp me" is unclear ?
> [ or did you mean to say put the short name of grp tGroup into ... ? ]
> -- Alex.
> On 14/08/2015 23:50, William Prothero wrote:
>> I just encountered what appears to be an error in the group function.
>> To duplicate, make a new stack.
>> Make a graphic for a background
>> Make a button
>> group the graphic and the background
>> Name the group something, anything, like “myGroup”
>> inside the button script, put:
>> on mouseUp
>> send "getGroup" to grp "myGroup"
>> put the long name of me into lName
>> put wordOffset("Group",lName) into nw
>> put word nw+1 of lName into tGroup
>> put the short name of grp me into tGroup
>> answer tGroup
>> end mouseUp
>> in the group script, put:
>> on getGroup
>> put the short name of grp me into theGroupName
>> end getGroup
>> You will notice that the “put the short name of grp me ….” statement, the correct group name is in tGroup. However, if you continue past the breakpoint, the code fails. You can verify that the statement “put the short name of grp me into tGroup” works by putting a breakpoint in the group script.
>> It’s not a show-stopper, but seems to be a bug.
>> Verify, anybody?
>> William A. Prothero
>> 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