am I right with select and group?

Scott Rossi scott at tactilemedia.com
Tue Jun 5 11:36:23 EDT 2007


Recently, Ian Wood wrote:

> I assume my syntax with select and group isn't safe.
> 
> I've had occasional problems with this, but not consistently enough
> to do a bug report.

Ian, I wonder if you're running into an issue with nested groups.

If you have 2 groups on a card, and group B is nested inside group A, Rev
will say group B is the last group on the card because technically its layer
is higher than group A.  This is where scripts can get confused because if
you run the script:

 group grc 1 and grc 2 and grp B

...and then immediately reference "the last group", Rev thinks you want
group B instead of the group you just made.  "Last" doesn't work the same
here as it does when creating all other objects.  This is definitely a pain,
but one workaround is to set the name of the templateGroup to something
unique *before* you create a group, and then you can refer to the group you
want by name, rather than "the last group".

Hope this helps.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list