Purge a stack from memory

J. Landman Gay jacque at hyperactivesw.com
Fri Jul 26 16:25:27 EDT 2019

The word you want is "delete" but you will have to be careful. If you 
delete an open mainstack, it is purged from memory without saving, but the 
file remains intact on disk. However if you delete a substack, it is 
removed from the mainstack and if you subsequently save its mainstack the 
substack is gone forever. So you will need to delete the mainstack first 
before opening the mainstack B that contains substack X.

If they are both open at the same time who knows which one will be targeted 
for deletion.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On July 26, 2019 2:09:59 PM Paul Dupuis via use-livecode 
<use-livecode at lists.runrev.com> wrote:

> 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?
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

More information about the Use-livecode mailing list