Page 1 of 1
How to create a new card in a other stack ?[Solved]
Posted: Wed Jun 03, 2015 2:01 pm
by atout66
Hello friends,
I'd like to create a new card in a other stack
whithout to go there.
I've seen in the dictionnary that the create command creates objects in the
current card. That's not what I'm looking for.
I want to create a new card in a specific stack which I know the name. For example, this code below returns an error:
Code: Select all
create card laCardCreation to stack leTypeDeStack
but you get the idea...
Untill now, I was on a test process, and so, I was used to go from the card source to the last card target, create the new card there, create the fields of the new card, fill them, etc. and then, back to the card source.
This process is too long for me now, as I've 774 cards to create and fill !
If you know a better way to do that, please let me know
Regards, Jean-Paul.
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 2:08 pm
by Klaus
Hi Jean-paul,
you need to set "the defaultstack"!
This will do the trick:
...
set the defaultstack to "name of your other stack here"
create cd "name of new card"
...
Best
Klaus
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 2:47 pm
by atout66
Thanks Klaus, I give a look, but I'm afraid it doesn't work, because the dictionnary says:
Value:
The defaultStack is the name of an open stack.
My problem is that I proceed from the main stack and the others are not open.
In fact, I've to build the content of the application now that the interface is done.
But I try first to see, who knows...
Regards, Jean-Paul.
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 3:06 pm
by dunbarx
Hi.
That is misleading. The use of the defaultStack usually refers to the topmost stack, but it does not have to.
Make two stacks. Name one "AA" and the other "BB". Save both. In a button on "AA":
Code: Select all
on mouseUp
set the defaultStack to "longNameOfStackBB" --you understand this, right?
create card
end mouseUp
Now quit LC. Open stack "AA" and hit the button. If you now go to stack "BB", you will find a new card there.
Craig Newman
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 3:16 pm
by atout66
dunbarx wrote:That is misleading...
This sounds nice. I'll give it a try in two hours, when the calculations of LC will finish.
I'll let you know
Regards, Jean-Paul.
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 7:56 pm
by SparkOut
When I get a chance (using phone here) I will check, but that is interesting. When you create a card it normally becomes the active card. Does it not force the destination stack open to become active?
I have always created new cards in the current stack, and had to lock screen, and revert to the original card in order to simulate "silently" creating a new card.
(Using "invisible" has never worked for cards for me)
Re: How to create a new card in a other stack ?
Posted: Wed Jun 03, 2015 8:22 pm
by dunbarx
Sparkout.
Try it. The target stack does not appear in the stacksInUse. It never seems to rear its head.
But note that just because you can create a new card on that remote stack, those new cards will not stick unless you save that stack. So in a sense, you very well may have to "go" there, even if only to save the stack by specifying its pathname:
Craig
Re: How to create a new card in a other stack ?
Posted: Thu Jun 04, 2015 7:33 am
by atout66
I did the test and it works very well, even more than what I expected
I can do all the process on the same card all the time and let the machine populate the cards; great

Thanks a lot to all of you for your help, this forum is fantastic !
Regards, Jean-Paul.