Cannot really purge
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Cannot really purge
Dunno, but I am probably reading the docs incorrectly
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot really purge
All.
This has turned into a lively discussion.
"doMenu" does not work in this case. In fact, ever since I started LC I have found that it mostly does not, and therefore I have abandoned ever thinking about it. However, If it did work here, I would jump on it, and make my plug-in to trap all "close" messages, since I always want full purging.
Anyway, I will jump in tomorrow and let everyone know.
But that still begs the issue that the "purge"-like settings di nothing for me at all.
Craig
This has turned into a lively discussion.
"doMenu" does not work in this case. In fact, ever since I started LC I have found that it mostly does not, and therefore I have abandoned ever thinking about it. However, If it did work here, I would jump on it, and make my plug-in to trap all "close" messages, since I always want full purging.
Anyway, I will jump in tomorrow and let everyone know.
But that still begs the issue that the "purge"-like settings di nothing for me at all.
Craig
Re: Cannot really purge
We are talking about in the IDE though, not in a standalone where I am pretty sure it does exactly as intended. In the IDE, I think slightly different rules apply, I suspect for good reasons.
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot really purge
Hmmm.We are talking about in the IDE though, not in a standalone where I am pretty sure it does exactly as intended. In the IDE, I think slightly different rules apply, I suspect for good reasons.
I never thought about it that way. i assume that a standalone would not contain multiple instances of the same stack. But I guess it could be so. But this is not an issue of LC throwing an error, though a modal dialog does indeed have to be manually dismissed, and that could cause the standalone to fail.
Anyway, I think rather it is in the IDE that such methods, of working with several versions of a stack as one develops, is more common.
Is it not so?
Craig
Re: Cannot really purge
Yes, I'd agree with that, but there is a specific method to do that as well, you'd clone the stack (as many times as you like), and work on each copy of it. Alternately, you could save each variation, changing the name of the stack slightly , i.e. myStack1, myStack2, etc. which is the easiest way, especially if you have a ton of substacks below it.
I haven't tested what happens if you have a substack that is the same as another substack open at the same time yet though. Hmmm. Wonder if the universe explodes at that point...
Re: Cannot really purge
I just created some test stacks and cannot reproduce this issue. I'm using DP11 on Win10.
I created a new default stack (named Untitled 1). I checked the "Purge stack on close" option using the stack inspector. I saved the file on the desktop. I closed the file with the "x" and verified that it no longer appeared in the PB.
On the desktop, I created 2 new folders: f1 and f2. I copied the stack file and placed a copy in each folder.
In LC, I opened the one in f1 and closed it. I then opened the one in f2 and closed it. I did not receive any dialog boxes to purge. I can use the recent files to open any of the 3 copies of the file without a dialog as long as the previous is closed with the "x".
I also saved a copy to the desktop without the purge option checked (same stack name, different file name). If I open that stack and close with the "x", I will get a purge dialog when attempting to open another copy of the stack.
So, my thought is that there is something else going on that is keeping your particular stack in memory. Is the stack in question a sub-stack of something else or does it have sub-stacks? Does any other object in memory reference it (as a behavior for example)?
One example that I came up with was to open one of those stacks and create a sub-stack. If that sub-stack was open, then the parent would not get purged until the sub-stack was closed. If I closed the sub-stack first, then the parent was immediately purged when closed (even without saving the file with the new sub-stack).
- Brian
I created a new default stack (named Untitled 1). I checked the "Purge stack on close" option using the stack inspector. I saved the file on the desktop. I closed the file with the "x" and verified that it no longer appeared in the PB.
On the desktop, I created 2 new folders: f1 and f2. I copied the stack file and placed a copy in each folder.
In LC, I opened the one in f1 and closed it. I then opened the one in f2 and closed it. I did not receive any dialog boxes to purge. I can use the recent files to open any of the 3 copies of the file without a dialog as long as the previous is closed with the "x".
I also saved a copy to the desktop without the purge option checked (same stack name, different file name). If I open that stack and close with the "x", I will get a purge dialog when attempting to open another copy of the stack.
So, my thought is that there is something else going on that is keeping your particular stack in memory. Is the stack in question a sub-stack of something else or does it have sub-stacks? Does any other object in memory reference it (as a behavior for example)?
One example that I came up with was to open one of those stacks and create a sub-stack. If that sub-stack was open, then the parent would not get purged until the sub-stack was closed. If I closed the sub-stack first, then the parent was immediately purged when closed (even without saving the file with the new sub-stack).
- Brian
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
Re: Cannot really purge
Huh, i had read (and forgotten) that the mainstack won't close out completely until all the substacks had closed, but didn't think about it in this case. That makes a lot of sense taken in that context. Now to remember where I read it
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot really purge
Brian.
You make an excellent point, in that perhaps a substack may not have those properties set, and complain about their lowly status. And my mainstack does indeed have four substacks.
But all four have both properties set.
I am on a Mac, LC 8.1.8, but this issue has been forever.
Going to see if I can access the menuItem as Bogs suggested, and then make a plug-in to purge always.
Craig
You make an excellent point, in that perhaps a substack may not have those properties set, and complain about their lowly status. And my mainstack does indeed have four substacks.
But all four have both properties set.
I am on a Mac, LC 8.1.8, but this issue has been forever.
Going to see if I can access the menuItem as Bogs suggested, and then make a plug-in to purge always.
Craig
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Cannot really purge
My earlier remark
worked perfectly.
So, missing something.
is nonsense because this:Probably because "Close and Remove From Memor&y" is NOT one word.
Code: Select all
on mouseUp
send "menuPick New Card" to btn "Object" of stack "revMenubar"
end mouseUp
So, missing something.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Cannot really purge
I was missing something!
I was 'DISTRACTED' by the ampersand!
This:
Cuts the mustard.
I was 'DISTRACTED' by the ampersand!
This:
Code: Select all
on mouseUp
send "menuPick Close and Remove From Memory" to btn "File" of stack "revMenubar"
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot really purge
Thanks to all.
I should have been able to find this for myself, since I am the one who constantly tells anyone who will listen that everything in the LC IDE is merely a stack. But that is why this forum is so useful.
I made a simple plug-in, with this in its stack script
@Richmond. I like my slight modification better. Just old practice; LC could care less.
Interestingly, when on invokes this directly from the menuBar a dialog pops up asking if this is really what is desired. I say yes and it works. But when simply closing a stack, no such dialog appears. Why, I wonder?
Anyway, no more dialogs asking about purging.
Craig
I should have been able to find this for myself, since I am the one who constantly tells anyone who will listen that everything in the LC IDE is merely a stack. But that is why this forum is so useful.
I made a simple plug-in, with this in its stack script
Code: Select all
on closeStack
send "menuPick" && "Close and Remove From Memory" to btn "File" of stack "revMenubar"
end closeStack
Interestingly, when on invokes this directly from the menuBar a dialog pops up asking if this is really what is desired. I say yes and it works. But when simply closing a stack, no such dialog appears. Why, I wonder?
Anyway, no more dialogs asking about purging.
Craig
Re: Cannot really purge
Nice Richmond, glad you got the (amper) sand out of your eye
Congrats Craig
Congrats Craig
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Cannot really purge
You're getting the dialog because that's what the menu item does. Closing a stack by its close box doesn't call the menu.
I think there is something specific about your stack that prevents it from closing completely. The window will close but it remains in memory. There are a few things that could cause this: the stack is in use as a library or back/front script; a handler has not completed; it has opened a driver or external and hasn't closed it; other things I can't remember right now.
Basically if the stack sets up a dependancy it won't close until the dependancy is removed. I suspect you wouldn't have the same problem if you tested with several plain, same-named stacks.
I think there is something specific about your stack that prevents it from closing completely. The window will close but it remains in memory. There are a few things that could cause this: the stack is in use as a library or back/front script; a handler has not completed; it has opened a driver or external and hasn't closed it; other things I can't remember right now.
Basically if the stack sets up a dependancy it won't close until the dependancy is removed. I suspect you wouldn't have the same problem if you tested with several plain, same-named stacks.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot really purge
Jacque.
So I made two new empty stacks. I set the usual suspects. I always get the dialog closing and re-opening them in succession.
This does not mean it is not me. just that it is not me.
Craig
That all makes sense. But unfortunately for me, I have never subscribed to making sense.There are a few things that could cause this: this...
So I made two new empty stacks. I set the usual suspects. I always get the dialog closing and re-opening them in succession.
This does not mean it is not me. just that it is not me.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Cannot really purge
I just repeated your experiment and didn't get any warning dialogs. I could open/close both test stacks without interference. What version of LC are you running?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com