Long Standing Issue with the defaultStack

Bob Sneidar bobsneidar at iotecdigital.com
Sat Apr 18 16:48:01 EDT 2020


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



> On Apr 18, 2020, at 12:56 PM, Mark Wieder via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> On 4/18/20 11:33 AM, Bob Sneidar via use-livecode wrote:
> 
>> Until I can figure out what is causing it, I cannot trust the defaultStack.
> 
> I think the basic lesson here is "if you're going to rely on the defaultstack you should set the defaultstack".
> 
> -- 
> Mark Wieder
> ahsoftware at gmail.com



More information about the use-livecode mailing list