BrainDead on Groups

Thomas McGrath III mcgrath3 at mac.com
Mon Jul 8 18:12:47 EDT 2013


I always seem to get messed up when working with groups.

I have a group with groups in it and subgroups in those groups like this:

MainGroup
Index1
	SubGroup1
	SubGroup2
Index2
	SubGroup1
	SubGroup2
Index3
	SubGroup1
	SubGroup2
Index4
	SubGroup1
	SubGroup2
Index5
	SubGroup1
	SubGroup2

I am trying to get the number of groups in group "MainGroup" but I am getting all sub groups as well.

 put the number of groups of group "MainGroup" into tGroups

gives me 15 groups instead of 5 like I would like.


What I would like to do is delete group "Index3" and then rename the the rest so that they are in order again. 
I was planning on using a repeat loop on the number of groups:

repeat with x = 1 to the number of groups of group "MainGroup"
	set the name of group x of group "MainGroup" to ("Index" & x)
end repeat

Then when I want to add a group I can just clone the first group and rename it. I would like to name it 1 + the number of groups like:

clone group "Index1" of group "MainGroup"
set the name of it to ("Index" & (the number of groups of group "MainGroup" + 1))


The problem is that because some of the groups have groups in them I am not getting the right number back from using "the number of".

Help?!

Tom

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgrath3 at mac.com




More information about the use-livecode mailing list