Purge a stack from memory

Paul Dupuis paul at researchware.com
Fri Jul 26 15:08:07 EDT 2019


I know this comes up again and again, is there some counterpart to 
"revLoadedStacks(application)" that can PURGE a stack from memory?

If you have a stack open, say stack "A" and you open a different stack 
file with a stack called "A", the IDE presents a message about stacks 
with the same name and what do you want to do with essentially "Cancel" 
(opening the new stack) or "Purge" (the old stack without saving) or 
"Save" (the old stack and purge)

What does the IDE do to purge a stack?

I ask as I have the following case:

I have a stack open in the IDE (Call it "A") that uses another stack 
(not a substack), call it "X" as a library stack. That stack needs to 
make a scripted change to another mainstack (call it "B") with a 
substack, also  it "X", with the same name as the library stack (yes, 
the naming could have been better, but these are old stack made by 
different people and renaming stuff would be a real pain in the butt)

I have tried:
stop using stack "X"
set the destroyStack of stack "X" to true
close stack "X"
wait 0 with messages -- give time to close and remove the stack from memory

-- then open the other stack "X"
-- and do what I need

Yet when I try this, I get the IDE message about stacks of the same name.

Any tips on how to positively, absolutely purge a stack from memory?




More information about the use-livecode mailing list