Getting only the immediate child groups of a group

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jason.lubken
Posts: 4
Joined: Wed Jun 06, 2007 6:35 pm

Getting only the immediate child groups of a group

Post by jason.lubken » Fri Sep 14, 2007 4:25 pm

I've tried something like...

Code: Select all

function childGroupExists theChildGroupName, theParentGroup
  repeat with i = 1 to the number groups in theParentGroup
    if the name of group i of theParentGroup is theChildGroupName then
      return true
    end if
  end repeat
  return false
end childGroupExists

... but "the number of groups" is not restricted to immediate children only, so the code iterates through all of the child and grandchild groups of theParentGroup.

Is there something like groupNames for groups instead of cards?

Thanks

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Fri Sep 14, 2007 5:45 pm

Unfortunately there is no way of getting direct Group children. This is very unfortunate as interrogating groups for immediate children becomes very slow as the number of controls grows.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply