On Mon, Dec 8, 2014 at 5:33 PM, Scott Rossi <sc...@tactilemedia.com> wrote:
> Admittedly, the cardOwnerID function could fail if a control was located > within a nested group that was explicitly named “card id” but. . . > Exactly why I did it the way I did. I do like the use of the id in returning the name, and it occurs to me that it would be better to accept any valid reference instead of demanding the long name or id as my earlier functions did, so I would revise as: function owningStack pID if word -5 of the long id of pID is "stack" then return word -5 to -1 of the long id of pID else return word -2 to -1 of the long id of pID end owningStack For the card id: function owningCardID pID if word -5 of the long id of pID is "stack" then return word -9 to -1 of the long id of pID else return word -6 to -1 of the long id of pID end owningCardID And for the card name: function owningCardName pID return the long name of owningCardID(pID) end owningCardName I'm a bit sad to see the change to owningCardName -- I started with a horribly nested if statement, and I was very proud to get it down to those two lines before. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode