Learned my lesson
Bob Sneidar
bobsneidar at iotecdigital.com
Fri Apr 17 21:41:29 EDT 2020
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
More information about the use-livecode
mailing list