How to check if a group contains a specific control ?

Brian Milby brian at milby7.com
Fri Aug 23 08:48:15 EDT 2024


Another alternative.

If the short id of fld "xyz" is among the lines of the childcontrolids of group "abc" then …

This one should work as long as there is only one field with that name on the card (tried from message box).

Brian Milby
brian at milby7.com

> On Aug 23, 2024, at 8:05 AM, Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> On 8/23/2024 7:45 AM, Klaus major-k via use-livecode wrote:
>> Hi jbv,
>> 
>>>> Am 23.08.2024 um 13:27 schrieb jbv via use-livecode <use-livecode at lists.runrev.com>:
>>> 
>>> Hi list,
>>> 
>>> Is there a quick way to check if a group contains a specific control,
>>> something like :
>>> if there is a fld "xyz" in grp "abc" of this cd
>>> I tried many things but it always generates an error.
>>> So far, the only way I can think of is to maintain a custom prop
>>> for each group, featuring a string that is the list of all controls
>>> names of the group.
>> if you don't have any other controls with the same name,
>> you could check:
>> -> lineoffset("xyz",the childcontrolnames of grp "abc")
>> 
> 
> or, if you prefer:
> 
> if "xyz" is among the lines of the childcontrolnames of group "abc" then
> 
> NOTE: As mentioned, "xyz" would need to be a unique name for control in the group. If you have a field "xyz" and a button "xyz" (or 2 buttons or 2 or more fields with the same name, etc.) this is not accurate.
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


More information about the use-livecode mailing list