Problem with error message "Another Stack is open"

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 121
Joined: Fri Mar 09, 2007 9:47 pm

Problem with error message "Another Stack is open"

Post by jsburnett » Wed Sep 17, 2008 2:15 pm

I have written a stack that stores information in another stack (ie - the main stack writes and retrieves inforamation to and from another stack - data stack). During the course of using the stack, the stack that holds the information is copied and stored in a 'data folder' (ie - each stack represents information related to a person and is labeled as such). I never open the stacks - just copy them, change their names, and 'put' and 'get' information from fields on the stacks. I've set the stack - data stacks - to 'purge' on closing and this doesnt help. I am not surprised since I never 'open' the stacks and have checked in the process of debugging and the stack(s) in question are not listed in the openStacks. I have decided to use stacks since the information can change frequently and deleting and rewriting text files seemed to be a poor choice.

Any suggestions would be helpful.

Thanks,
John

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Sep 17, 2008 2:21 pm

Hi John,

As soon as you refer to a stack, it is loaded into memory, regardless of whether you use the open or go commands.

it might seem weird, but if you delete the stack from memory after saving it, you can load the next stack without problems.

Code: Select all

save stack x
close stack x
open stack x -- other stack x
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 121
Joined: Fri Mar 09, 2007 9:47 pm

Thanks - regarding Error, another stack already open ...

Post by jsburnett » Thu Sep 18, 2008 10:22 pm

I tried it and it worked. Although I dont open the stack, I guess when I 'put' or 'get' stuff from it, I need to 'close' it. Thanks for your help.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Sep 19, 2008 1:14 am

Hi JS,

Actually, I believe I wanted to write

Code: Select all

save stack x
delete stack x
open stack x -- other stack x
But if you have the destroyStack property of your stacks set to true, it shouldn't matter.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply