the defaultStack changes on resume

Bob Sneidar bobsneidar at iotecdigital.com
Wed Aug 9 12:48:04 EDT 2017


Here is an updated version that should work with any stack name:

function getParentStack pObjectID
    put offset("stack ", pObjectID) into tStartChar
    put char tStartChar to -1 of pObjectID into tParentStack -- the long name of the parent stack
    return tParentStack
end getParentStack

Bob S


> On Aug 9, 2017, at 09:41 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> BTW I worked around this by using my getParentStack() function. Here it is:
> 
> 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 wordOffset("stack", pObjectID) into tFirstWord
>    put word tFirstWord to tFirstWord +1 of pObjectID into tParentStack
>    return tParentStack
> end getParentStack
> 
> NOTE: I only use single word stack names. This function will have to be reworked to account for multi-word stack names. Honestly though, if people would follow basic conventions about naming things, everything gets much simpler. 
> 
> Bob S
> 
> 
> 
>> On Aug 9, 2017, at 09:08 , Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Has any one run into the following situation in LiveCode standalones?
>> 
>> In a multiple window application, the user has either a standard window
>> or a modal dialog open (the topWindow which is also the defaultStack).
>> They navigate to a 3rd party application and by some means back to the
>> LC standalone and click a control in the topWindow (again either a
>> standard window or dialog) and that window is NO LONGER the defaultStack
>> so an execution error occurs on the first control referenced that is not
>> fully qualified.
>> 
>> Obviously, I can fix this by fully qualifying all my object references
>> (i.e. instead of using fld "x", using fld "X" of stack "Y") but I am
>> curious is anyone else has seen anything like this?
> 
> 
> _______________________________________________
> 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