Learned my lesson

Phil Davis phil at pdslabs.net
Fri Apr 17 21:53:08 EDT 2020

I feel your pain! I switched to using "of me" or "of the owner of me" 
whenever possible which works very well in many/most cases, but 
sometimes it just isn't enough.

Phil Davis

On 4/17/20 6:41 PM, Bob Sneidar via use-livecode wrote:
> I just spent 2 hours purging the detestable “this stack” from my entire list of projects. If you use substacks, if you hide and show stacks, this stack simply unreliable. Instead put this at the head of every script that needs to know what the parent stack is:
> put getParentStack(the long id of me) into tParentStack
> and have this in a library or active script somewhere:
> function getParentCard pObjectID
>     put offset("card id", pObjectID) into tStartChar
>     put char tStartChar to -1 of pObjectID into tCardID
>     return tCardID
> end getParentCard
> function getParentStack pObjectID
>     put offset("stack ", pObjectID) into tStartChar
>     put char tStartChar to -1 of pObjectID into tParentStack
>     return tParentStack
> end getParentStack
> Now you will know ABSOLUTELY which stack you are in from any object on any card. And no, I’m not senile (much yet) I know I already posted this some time ago.
> Bob S
> _______________________________________________
> 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

Phil Davis

More information about the use-livecode mailing list