On 20/09/2013, at 11:47 PM, "Dr. Hawkins" <[email protected]> wrote:
> As near as I can tell, there is no concept of "the group of me" or a
> similar way to get the group containing the target, other than things like
> "word 5 of the long name of me"
>
> Quick access to such things, as well as completing the set of groupNames to
> include fieldNames, buttonNames, and similar "completions" sure would be
> nice . . .
I agree we don't really have access to enough metadata about an object. I would
like the stack|card|sharedGroup of me
Here's a workaround from the lcVCS code which recursively finds the parent
object of the requested type. If you need the sharedGroup pShared should be
true. As Klaus said if you just want the direct parent then the owner works
fine.
function FindParent pObject,pType,pShared
local tStat = "true",tType
put word 1 of pObject into tType
if tType is "bkgnd" then
put "group" into tType
end if
if pShared then
if tType is "group" then
put the sharedBehavior of pObject into tStat
else if word 1 of pObject is "card" then
return empty
end if
end if
if tType is pType and tStat then
return pObject
else
return FindParent(the long owner of pObject,pType,pShared)
end if
end FindParent
--
Monte Goulding
M E R Goulding - software development services
mergExt - There's an external for that!
_______________________________________________
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