Completely purging a stack from memory when closed....
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Completely purging a stack from memory when closed....
Hi Justin,
This is what I use in my projects.
No need to keep a list of the stacks you need to close.
on QuitMyProject
lock messages
-- stop using stacks
put the stacksInUse into myStacks
repeat for each line myStack in myStacks
stop using stack myStack
end repeat
-- stacks
put the openStacks into myStacks
put "message box,home,tool,Message Box,revTools,revMenubar" & comma & the short name of me into myDontClose
repeat for each line myStack in myStacks
if myStack is not among the items of myDontClose then close stack myStack
end repeat
-- messages
put the pendingmessages into myMsgs
repeat for each line myMsg in myMsgs
cancel item 1 of myMsg
end repeat
set the backdrop to none
close me
if the environment is not "development" then
quit
end if
end QuitMyProject
This is what I use in my projects.
No need to keep a list of the stacks you need to close.
on QuitMyProject
lock messages
-- stop using stacks
put the stacksInUse into myStacks
repeat for each line myStack in myStacks
stop using stack myStack
end repeat
-- stacks
put the openStacks into myStacks
put "message box,home,tool,Message Box,revTools,revMenubar" & comma & the short name of me into myDontClose
repeat for each line myStack in myStacks
if myStack is not among the items of myDontClose then close stack myStack
end repeat
-- messages
put the pendingmessages into myMsgs
repeat for each line myMsg in myMsgs
cancel item 1 of myMsg
end repeat
set the backdrop to none
close me
if the environment is not "development" then
quit
end if
end QuitMyProject
Andy .... LC CLASSIC ROCKS!
Re: Completely purging a stack from memory when closed....
Great tip! Thanks, Andy!
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Re: Completely purging a stack from memory when closed....
And if you only want to close substacks, you don't even need the list of stacks to exclude. You can just do this:
This only works with substacks, not with separate stacks that aren't part of the main stackfile. Andy's works with all open stacks, regardless of their origin.
Code: Select all
repeat for each line myStack in the substacks of this stack -- assumes the script is in the mainstack
close stack myStack
end repeat
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Completely purging a stack from memory when closed....
Would Andy's version close stacks that are open outside of the current program? ie, if I am running two different programs created in LC, would it close both of them if I executed the script from only one? I am not advanced enough to be using outside stacks in any of my programs, but I am getting close to that point...... I made an order management program to monitor all of the designs that come through our system, and it would be cool if I could select a design and then click "LOAD IN DESIGN LAB" to have the main Design Lab program open up and automatically load the design that was selected in the management program..... Of course, that is a thread for another day. haha
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Re: Completely purging a stack from memory when closed....
Hi Justin,
please define "the current program"?
Do you mean different standalones?
If the latter, then every standalone lives in its own "world" and will of course only handle
its own "components" (= substacks) and docs that had been opened by that namely standalone.
So the answer to this question:
Best
Klaus
please define "the current program"?
Do you mean different standalones?
If the latter, then every standalone lives in its own "world" and will of course only handle
its own "components" (= substacks) and docs that had been opened by that namely standalone.
So the answer to this question:
is NO!Would Andy's version close stacks that are open outside of the current program?
Check "launch DOCUMENT with APPLICATION" in the dictionary!it would be cool if I could select a design and then click "LOAD IN DESIGN LAB" to have the main Design Lab program open up and automatically load the design that was selected in the management program..
Best
Klaus
Re: Completely purging a stack from memory when closed....
Thanks Klaus! You are correct - I was asking what would happen if I had two distinctly different standalone applications running when the command is executed. That clarifies things for me!
I will look into that "launch DOCUMENT with APPLICATION" function!
I will look into that "launch DOCUMENT with APPLICATION" function!
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Re: Completely purging a stack from memory when closed....
It appears as though the "launch DOCUMENT with APPLICATION" function would open a pre-existing (ie, complete / finished) document using the specified program...... What I am trying to accomplish would be selecting a Design from one program, then opening it in another LC program I created to edit a design. Each design has a lot of information associated with it on the server (in a MySQL database), so I would need to load all the information for the design in the Design Lab when it is forced to open, to properly display the design.
The caveat here is that a "design" is simply a collection of information stored on the server (DB info for displaying all of the design elements properly, as well as associated image assets for the selected design), rather than an actual single file stored on the local system.
In the next day or so I will create a new thread to address this issue, since I feel as though it might take some careful thought to execute as I have envisioned... In the meantime, I will continue researching the Launch command to see if I am missing anything that might help.
The caveat here is that a "design" is simply a collection of information stored on the server (DB info for displaying all of the design elements properly, as well as associated image assets for the selected design), rather than an actual single file stored on the local system.
In the next day or so I will create a new thread to address this issue, since I feel as though it might take some careful thought to execute as I have envisioned... In the meantime, I will continue researching the Launch command to see if I am missing anything that might help.
-------------------------------------------------------------------------------------------------------------
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com
Some things I do: http://www.katanadtg.com --- http://www.dtgprintsolutions.com