Hi,
I've made so many changes to a substack that is used for all my projects that I'm working on, that I would rather be able to just remove the old substacks and replace them with the new one. I've save the new substack to a separate file, but I don't find any information to import it as part of my mainstack now. Is this at all possible?
Thanks,
Johan
replace a substack | SOLVED
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
replace a substack | SOLVED
Last edited by Johan_VH on Mon Aug 04, 2014 1:58 pm, edited 1 time in total.
Re: replace a substack
I was too fast posting a question about it. I just figured it out myself.
Just in case anyone else ever has the same issue: Open the new stack, go to the property inspector of the stack and in 'basic properties' select the main stack it should belong to.
Just in case anyone else ever has the same issue: Open the new stack, go to the property inspector of the stack and in 'basic properties' select the main stack it should belong to.

Re: replace a substack
Dag Johan,
this is simple:
1. Delete the old substack and save the mainstack
2. QUIT Livecode (may not be neccessary, but I am cautious after 15 ears of using this software!)
3. Restart and open the mainstack and the new substack, which is still another mainstack.
4. In the Inspector for the new substack, set its mainstack to your "main" stack and save.
5. Done
Best
Klaus
this is simple:
1. Delete the old substack and save the mainstack
2. QUIT Livecode (may not be neccessary, but I am cautious after 15 ears of using this software!)

3. Restart and open the mainstack and the new substack, which is still another mainstack.
4. In the Inspector for the new substack, set its mainstack to your "main" stack and save.
5. Done

Best
Klaus
Re: replace a substack | SOLVED
Thanks again Klaus!
I will go the safe way and do it again with saving and quitting now.
Follow up question: is it possible to have my substacks that are the same for all my projects (in my case the screensaver and the registration) in a central location and link to them from every project so they only get packaged together when I make my runtime?
Johan
I will go the safe way and do it again with saving and quitting now.
Follow up question: is it possible to have my substacks that are the same for all my projects (in my case the screensaver and the registration) in a central location and link to them from every project so they only get packaged together when I make my runtime?
Johan
Re: replace a substack | SOLVED
Dag Johan,
One might be this:
When you create a standalone your mainstack will receive the message "savingstandalone" so you could catch this message and write
script that will make these stacks SUBSTACKS of the standalone mainstack.
Something like this (out of my head!):
Or if all these stacks are already open in Livecode when you create the standalone, you can address these stacks directly:
Another way is to add these stacks via the "Copy fiels" TAB in the standalone builder settings and late "start using" them as a "library":
Thsi should go into the standalone mainstack script:
You get the picture
Best
Klaus
yes, there are several ways to do so!Follow up question: is it possible to have my substacks that are the same for all my projects (in my case the screensaver and the registration)
in a central location and link to them from every project so they only get packaged together when I make my runtime?
One might be this:
When you create a standalone your mainstack will receive the message "savingstandalone" so you could catch this message and write
script that will make these stacks SUBSTACKS of the standalone mainstack.
Something like this (out of my head!):
Code: Select all
on savingstandalone
put "path/to/your library/stack.livecode" into tStack
lock messages
go stack tStack
set the mainstack of stack tStack to "name of your standalone mainstack here..."
close stack tStack
unlock messages
end savingstandalone
Code: Select all
...
set the mainstack of stack "your libstack1" to "name of your standalone mainstack here..."
...
Thsi should go into the standalone mainstack script:
Code: Select all
on openstack
start using stack "path to/lib/stack.livecode"
## ...
end preopenstack

Best
Klaus