Understanding 'the defaultStack'

Mark Waddingham mark at livecode.com
Tue Oct 11 05:08:44 EDT 2016


On 2016-10-11 11:01, Mark Waddingham wrote:
>   2) If the defaultStack is changed in a handler called from another
> handler, should the change propagate back up to the caller?
> 
> I think (2) is definitely not wanted. If the locality of a change to
> the defaultStack propagates back to callers, then the callers loose
> control and knowledge of what they are actually acting on.

Note that this is *not* the current behavior. Changing the defaultStack 
in a callee will propagate the change back up to the caller.

i.e.

on mouseUp
   set the defaultStack to "Foo"
   changeDefaultStackInCallee
   answer the defaultStack -- will be "Bar"
end mouseUp

on changeDefaultStackInCallee
   set the defaultStack to "Bar"
end changeDefaultStackInCallee

Here you'll get 'Bar' in the answer dialog.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list