Long Standing Issue with the defaultStack

Bob Sneidar bobsneidar at iotecdigital.com
Sat Apr 18 17:02:04 EDT 2020


By the way, this has NOTHING to do with substacks as I initially thought. The same thing happens with separate stacks. 

> On Apr 18, 2020, at 1:48 PM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Okay I created a simple stack with one sub stack. In the card script of stack 1 I put the handler:
> 
> on openStack
>   put the defaultStack & cr into msg
>   open stack "untitled 2"
>   put the defaultStack & cr after msg
>   open me
>   put the defaultStack & cr after msg
> end openStack
> 
> I get:
> stack "Untitled 1"
> stack "Untitled 2"
> stack "Untitled 2”
> 
> It seems going,opening a stack sets the opened stack to the default… IF IT’s NOT ALREADY OPENED! If it IS, well then you are on your own. The defaultStack is the last stack opened. (I’m assuming it’s a normal stack and not a pallet or something else). 
> 
> Now you would think at this point you can use topStack instead, but NAY! This script:
> 
> on openStack
>   put the defaultStack && the short name of the topStack & cr into msg
>   open stack "untitled 2"
>   put the defaultStack && the short name of the topStack & cr after msg
>   go me
>   put the defaultStack && the short name of the topStack & cr after msg
> end openStack
> 
> produces:
> stack "Untitled 1" Untitled 1
> stack "Untitled 2" Untitled 2
> stack "Untitled 2" Untitled 2
> 
> After I go me, neither the defaultStack nor the topStack changes! What is more, the untitled 2 stack still has focus!! 
> 
> Just to be certain I disabled all my plugins and relaunched, same thing. 
> 
> This CANNOT BE RIGHT! And if it is the expected behavior, it ought not be. 
> 
> Bob S


More information about the use-livecode mailing list