Thanks Scott, that works great. FWIW, I think I figured out why this happens. I believe "last" in this context refers to the group with the highest layer number. When I create the outer group, all the groups within it have to be relayered to have a higher layer number than the outer group, qed.
Pete lcSQL Software <http://www.lcsql.com> On Sat, Apr 13, 2013 at 1:33 PM, Scott Rossi <[email protected]> wrote: > One workaround is to set the name of the templateGroup before creating a > new group. This allows you to refer to the group by a custom name after it > is created, since "last" may not always be last. > > Regards, > > Scott Rossi > Creative Director > Tactile Media, UX Design > > On Apr 13, 2013, at 1:15 PM, Peter Haworth <[email protected]> wrote: > > > I think I ran into this a couple of years back but don't remember what > the > > workaround is. > > > > In some cases,, "the last group" does not return a reference to the last > > group created. I'm not sure of all the circumstances that cause this but > > here's my situation. > > > > My script creates several groups, let's call them grp1, grp2,grp3, and > > after creating them, uses a group command to group all those groups into > > one outer group. After the group command, I "set the name of the last > > group to "grpA". The group that gets renamed is not the outer group but > > grp3. > > > > The group command, unlike just about any other command that creates an > > object does not return an ID in "it" so I have to use "the last group" > > construct, as recommended in the dictionary actually. > > > > I guess I will have to search through the groups and find the one with > the > > highest ID to identify the outer group but before I do that, any ideas > > about how else to do this? > > > > Thanks, > > > > > > Pete > > lcSQL Software <http://www.lcsql.com> > > _______________________________________________ > > use-livecode mailing list > > [email protected] > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > > _______________________________________________ > use-livecode mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
