Is this a bug or expected behavior?
bobsneidar at iotecdigital.com
Wed Jul 1 00:56:20 CEST 2015
Fascinating, Captain. Putting the long id of group 1 of me resolves to the buttons long id. It is indeed ignoring “group 1 of”.
> On Jun 28, 2015, at 08:59 , Richard Gaskin <ambassador at fourthworld.com> wrote:
> Mike Bonner wrote:
> > Make a stack, put a button on it. In the script of the button put
> > "set the width of group 1 of me to random(the width of this card)
> > Apply, and click the button. The button width changes despite being
> > directed at a group that doesn't exist.
> > Is this expected behavior, or should I report it as a bug? It
> > behaves the same no matter what figmentary object you reference
> > before "of me". Apparently of me trumps all? Tested in 6.6.2 and 7.0.5
> Technically this may be a bug, because the statement can't logically resolve (groups can't be members of buttons), so one could argue that it should refuse to compile rather than try to guess at what you might have meant.
> I think what's happening there is that you've found a specific case of nested object references that confuses the engine to the point that it ignores the part that doesn't make sense ("group 1 of") and just uses the part that does ("me").
> Moving the script to the card level produces the expected result.
> Maybe it's worth filing a bug report on, but maybe that might have unanticipated side-effects on other forgiving things the interpreter does, so it may be tricky to resolve; I haven't read that part of the code base so I can't say.
> All I can recommend in the here-and-now is that if you find yourself writing object references that you know don't make sense and produce unexpected results, don't do that. :)
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> Ambassador at FourthWorld.com http://www.FourthWorld.com
> 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