Page 1 of 1
Importing a stack to an other one [SOLVED]
Posted: Wed Apr 30, 2014 7:47 am
by atout66
Hi to all,
Is there a way to import a stack with all its controls and scripts inside an other stack from an other LC file ?
For example I've build a test stack with controls and script and save it as <TEST_00.livecode>.
Then, I close LC, reopen it and start a new main stack with controls and save it as <TEST_01.livecode>...
After a while, I want to insert <TEST_00.livecode> inside <TEST_01.livecode>.

Can I do that ?
Kind regards, Jean-Paul.
Re: Importing a stack to an other one
Posted: Wed Apr 30, 2014 11:59 am
by Klaus
Bonjour Jean-Paul,
not sure I understannd you, but you cqan make every stack (wirthout substacks) a substack of another stack.
Is that what you mean?
Open both stacks and then write this in stack "TEST_01" in the message box or a button:
...
set the mainstack of stack "TEST_00" to "TEST_01"
...
Save stack "TEST_01" and that's it.
Best
Klaus
Re: Importing a stack to an other one
Posted: Wed Apr 30, 2014 1:26 pm
by atout66
Bonjour Klaus, et merci pour la réponse
You found the solution ! It sounds may be simple for you, but it wasn't at all for me.
I would advice to make a <save as> after using the commandWindow, to be sure there is no error...
Kind regards, Jean-Paul.
Re: Importing a stack to an other one [SOLVED]
Posted: Wed Apr 30, 2014 1:52 pm
by atout66
Arrrrght ! It's OK when the stacks don't have substacks.
Otherwise it doesn't work.
Not that simple in fact
Kind regards, Jean-Paul.
Re: Importing a stack to an other one
Posted: Wed Apr 30, 2014 6:23 pm
by jacque
A stack file can have only a single mainstack but can have any number of substacks. Substacks can't have their own substacks. Stacks can only nest by a single level.
There is a popup button in the General pane of the stack property inspector that lets you set a stack as a substack of a mainstack, so you don't need to use the message box if you don't want to.
Re: Importing a stack to an other one
Posted: Thu May 01, 2014 9:13 am
by atout66
Thanks Jacqueline and Klaus.
To resolve my problem, I set only one main stack first and placed all the others as subStack. Then, I've been able to make my changes according to my needs
Kind regards, Jean-Paul.