How to check if a target is a member 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: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

How to check if a target is a member of a group

Post by yeldarb » Sun Dec 31, 2017 8:02 pm

I'm sure I'm missing something simple, but I can't seem to figure out how to check if a clicked-on button is a member of a group. I've gotten this far:

Code: Select all

put the owner of the target
which correctly returns:

Code: Select all

group "responseGroup"
but if I change to

Code: Select all

put the owner of the target is grp "responseGroup"
I get an error:

Code: Select all

Chunk: source is not a container

yeldarb
Posts: 43
Joined: Thu Dec 14, 2017 5:39 pm

Re: How to check if a target is a member of a group

Post by yeldarb » Sun Dec 31, 2017 8:05 pm

Ok, I need to say "the name of," as in

Code: Select all

 put the owner of the target is the name of group "responseGroup"

bogs
Posts: 1761
Joined: Sat Feb 25, 2017 10:45 pm

Re: How to check if a target is a member of a group

Post by bogs » Sun Dec 31, 2017 9:28 pm

Fun when stuff like that trips you up, ain't it just?
Image

quailcreek
Posts: 691
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: How to check if a target is a member of a group

Post by quailcreek » Sun Dec 31, 2017 10:04 pm

If your code is in the group then I think what you want is something like this:

Code: Select all

put the short name of the owner of the target
If the code is in one of the members of the group then:

Code: Select all

put the short name of the owner of me
Tom
MacBook Pro OS High Sierra 10.13.3

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1683
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: How to check if a target is a member of a group

Post by [-hh] » Sun Dec 31, 2017 11:11 pm

You could use

Code: Select all

the childControlIDs of <group>
or

Code: Select all

the childControlNames of <group>
shiftLock happens

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”