Test for If Sub-Stack is Open
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Test for If Sub-Stack is Open
It's convenient that you can manipulate the objects of sub-stacks even when they are closed.
So I've got a Timer which keeps on firing, even after the Sub-Stack is closed.
Is there some way to test whether or not a stack is open or closed?
If not-- I could just use a global variable. Just curious.
So I've got a Timer which keeps on firing, even after the Sub-Stack is closed.
Is there some way to test whether or not a stack is open or closed?
If not-- I could just use a global variable. Just curious.
Re: Test for If Sub-Stack is Open
Hi.
I played around just a little, probably you did too.
The "stacks" only returns open stacks, and the "substacks" is more a property of a mainstack. But if your stack is not in "the stacks", it is not open. You could check this.
But I think you want to know if a stack (one with its "destroyStack" set to "false") is still in memory, even though closed, right?
No clue. But I bet there is a native property that does this. LC has everything else.
Craig
I played around just a little, probably you did too.
The "stacks" only returns open stacks, and the "substacks" is more a property of a mainstack. But if your stack is not in "the stacks", it is not open. You could check this.
But I think you want to know if a stack (one with its "destroyStack" set to "false") is still in memory, even though closed, right?
No clue. But I bet there is a native property that does this. LC has everything else.
Craig
Re: Test for If Sub-Stack is Open
I think what you're looking for is revloadedstacks
edited: Will show stacks, loaded into memory or visible and open.
edited: Will show stacks, loaded into memory or visible and open.
Re: Test for If Sub-Stack is Open
Thanks for your feedback on this.
I used:Then, it turns out, the revloadedstacks() function shows:
All stacks part of the main stack. In memory or not. Open or not.
I used:
Code: Select all
set the destroyStack of stack "mySubStack" to true
close stack "mySubStack"
All stacks part of the main stack. In memory or not. Open or not.
Re: Test for If Sub-Stack is Open
Hi guys,
hint: I think "revlodadedstacks()" and other "revXXX" commands/functions are only available in the IDE and not in runtimes!
Best
Klaus
hint: I think "revlodadedstacks()" and other "revXXX" commands/functions are only available in the IDE and not in runtimes!
Best
Klaus
Re: Test for If Sub-Stack is Open
Don't see anything contra-indicating use of this in a standalone, and the above paragraph seems to indicate it will work fine, but since I haven't tested it in a standalone your mileage may vary. Documentation and reality don't always mesh!Note: When included in a standalone application, the Common library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the revLoadedStacks function is not yet available. This may affect attempts to use this function in startup, preOpenStack, openStack, or preOpenCard handlers in the main stack. Once the application has finished starting up, the library is available and the revLoadedStacks function can be used in any handler.
Re: Test for If Sub-Stack is Open
Hi all,
oops, sorry, looks like I am not up-to-date
Best
Klaus
oops, sorry, looks like I am not up-to-date

Best
Klaus
Re: Test for If Sub-Stack is Open
If your stack app has the mainstack and all other stacks you use saved as substacks of the mainstack, then yes. You open the mainstack, viola' the main and substacks are shown in the app browser. (meaning the substacks are in memory) If you right click the substack in the app browser one of the options is to close it and remove it from memory.
If you have a main stack and load external stacks using code the stacks won't show up in the app browser and are not in memory (assuming they haven't been previously loaded) at which point it only shows "in memory" stacks.
As mentioned the destroystack property can change whether recently closed stacks are in memory or not.
At least I think this is how all this meshes together.
If you have a main stack and load external stacks using code the stacks won't show up in the app browser and are not in memory (assuming they haven't been previously loaded) at which point it only shows "in memory" stacks.
As mentioned the destroystack property can change whether recently closed stacks are in memory or not.
At least I think this is how all this meshes together.
townsend wrote:Thanks for your feedback on this.
I used:Then, it turns out, the revloadedstacks() function shows:Code: Select all
set the destroyStack of stack "mySubStack" to true close stack "mySubStack"
All stacks part of the main stack. In memory or not. Open or not.