Page 1 of 1

Copy Stack?

Posted: Wed Jan 09, 2013 6:28 pm
by lohill
Is there a way to copy a substack from one main stack to another main stack? If there is a way I would much prefer that to building the whole thing over again,

Thanks,
Larry

Re: Copy Stack?

Posted: Wed Jan 09, 2013 6:43 pm
by Klaus
Hi Larry,

not directly, but possible :D

Do something like this:
...
## Make a copy of the stack
## CLONE will automatically make a substack a mainstack and add "Copy of " to the name
## The substack does not need to be open!
clone stack "Name of substack" of stack "Mainstack"

## Set its mainstack
set the mainstack of stack "Copy of Name of substack" to "New mainstack"

## Now rename that stack if neccessary
set the name of stack "Copy of Name of substack" of "New mainstack" to "Name of substack"

## If neccessary:
close stack "Name of substack"
...
Tested and works 8)


Best

Klaus

Re: Copy Stack?

Posted: Wed Jan 09, 2013 6:48 pm
by lohill
Thanks Klaus,

I'll give it a try.

Larry

Re: Copy Stack?

Posted: Wed Jan 09, 2013 6:49 pm
by Klaus
Just tested and works! :D

Re: Copy Stack?

Posted: Wed Jan 09, 2013 7:18 pm
by lohill
Klaus,

Worked like a champ.

I did have to change:
set the name of stack "Copy of Name of substack" of "New mainstack" to "Name of substack"

to:
set the name of stack "Copy of Name of substack" of stack "New mainstack" to "Name of substack"

Thanks again for such a quick reply.
Larry

Re: Copy Stack?

Posted: Wed Jan 09, 2013 7:35 pm
by Klaus
Ah, yes, sorry, "made in a hurry" :D