Page 1 of 1

Problem with error message "Another Stack is open"

Posted: Wed Sep 17, 2008 2:15 pm
by jsburnett
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

Posted: Wed Sep 17, 2008 2:21 pm
by Mark
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

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

Posted: Thu Sep 18, 2008 10:22 pm
by jsburnett
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.

Posted: Fri Sep 19, 2008 1:14 am
by Mark
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