Importing a stack to an other one [SOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Importing a stack to an other one [SOLVED]

Post by atout66 » Wed Apr 30, 2014 7:47 am

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>. :wink:
Can I do that ?

Kind regards, Jean-Paul.
Last edited by atout66 on Thu May 01, 2014 9:13 am, edited 3 times in total.
Discovering LiveCode Community 6.5.2.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Importing a stack to an other one

Post by Klaus » Wed Apr 30, 2014 11:59 am

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

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: Importing a stack to an other one

Post by atout66 » Wed Apr 30, 2014 1:26 pm

Bonjour Klaus, et merci pour la réponse :wink:

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.
Discovering LiveCode Community 6.5.2.

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: Importing a stack to an other one [SOLVED]

Post by atout66 » Wed Apr 30, 2014 1:52 pm

Arrrrght ! It's OK when the stacks don't have substacks.
Otherwise it doesn't work.
Not that simple in fact :wink:

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Importing a stack to an other one

Post by jacque » Wed Apr 30, 2014 6:23 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: Importing a stack to an other one

Post by atout66 » Thu May 01, 2014 9:13 am

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 :wink:

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.

Post Reply