Copying card from one stack to another

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
félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Copying card from one stack to another

Post by félix » Mon Jan 08, 2018 9:51 pm

Hi,

I'm new here and it might be an obvious question, sorry for that.

One can open several stacks in LiveCode, but how to copy one card from one stack to another ? I've tried drag and drop, looked for a copy menu, with no success.

Thanks in advance
Félix

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copying card from one stack to another

Post by bogs » Mon Jan 08, 2018 10:03 pm

Dictionary using "copy" has a pretty good reference about it -
Platforms: Desktop, Server, Web and Mobile

Summary:
Copies selected text or an object to the clipboard or to a card, group, or stack.

Examples:
copy
copy button "next" to group "container"
copy this card to stack "Project 1"
copy word -3 to -1 of field "output"

Use the copy command to place objects or text on the clipboard, or to make a copy of an object without changing the contents of the clipboard.

Parameters:
The object is any available object. If no object or chunk is specified, the copy command copies whatever is currently selected.
Image

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Copying card from one stack to another

Post by félix » Tue Jan 09, 2018 1:41 pm

Thanks Bog,

I was more looking for a drag and drop sort of things, but it will do certainly.

Actually what I was aiming for can be done with the Project Browser: just grab one card from a stack and drop it in another stack.

I like however to be able to do it by code using the Message Box.

Bye
Félix

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copying card from one stack to another

Post by bogs » Tue Jan 09, 2018 3:19 pm

Oh I am sorry then, I completely misunderstood your question, heh. I thought you wanted to code this into an application.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Copying card from one stack to another

Post by dunbarx » Tue Jan 09, 2018 3:31 pm

Hi.

Welcome to LC.

Cards are special objects, very different than the controls that live on them. Though they share many attributes of controls, such as the properties that frame them, they are foundational windows and cannot be dragged, in the sense you thought.

So you must manage that under script control, as you now already know.

Craig Newman

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copying card from one stack to another

Post by bogs » Tue Jan 09, 2018 5:35 pm

I think what I got from his last post is he was trying to figure out how to do this in the IDE -
Image
Where you drag a card from one mainStack to another.

As he did find on his own, you can do this quite easily from the project browser, there are no context menus for it as he points out, but you can just drag it from one stack to the other (as well as any individual controls, etc.)
Image

félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Re: Copying card from one stack to another

Post by félix » Wed Jan 10, 2018 1:11 pm

I'm glad if I helped (re)discover this interesting feature that apparently is not very well known or documented (or both).

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copying card from one stack to another

Post by bogs » Wed Jan 10, 2018 9:58 pm

Yah, I think it is great, and use it all the time, but I also spend all my time in much older versions so I am a wierd duck. IF I had correctly interpreted your initial post, I would have also pointed this out, so it was a failure on my part heh.

I'm not sure about the project browser in the newest Lc's, I know reading posts between Jacque and Craig seems to indicate it tends to slow things down at the moment, but I am sure it will be fixed at some point. I don't think this works in the application browser at all, but the command line will work regardless of anything else (currently, can't speak for the future).

It is very handy, not just for moving cards, but for moving anything really, or lots of somethings. It is one of the few things I really miss when poking around in Mc, so I may have to cobble something together for that environment.
Image

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Copying card from one stack to another

Post by anmldr » Thu Jun 04, 2020 6:46 pm

Using the MsgBox
copy this card to stack "Project 1"
Thanks Bogs! This will save me a lot of time in cleaning up a project.

Linda

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copying card from one stack to another

Post by bogs » Thu Jun 04, 2020 10:19 pm

Glad to know it is still helpful, and that you got some mileage out of it :)
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”