How do you duplicate a card

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
uelandbob
Posts: 72
Joined: Mon Dec 29, 2014 3:28 pm

How do you duplicate a card

Post by uelandbob » Mon Dec 29, 2014 3:31 pm

In HyperCard you could make a duplicate of a Card. Is that possible in LiveCode?
uelandbob@gmail.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: How do you duplicate a card

Post by dunbarx » Mon Dec 29, 2014 3:45 pm

Whatever you could do in HC you can do in LC. Check out the dictionary for "copy".

There is still "doMenu", but mainly to be compatible with HC stacks that have been converted. Many of those commands will break in LC, though, so be careful. You can still do something like:

Code: Select all

 doMenu "New Card" of menu "Object"
Craig Newman

uelandbob
Posts: 72
Joined: Mon Dec 29, 2014 3:28 pm

Re: How do you duplicate a card

Post by uelandbob » Mon Dec 29, 2014 4:35 pm

Thanks for the answer, it worked. Here's a detailed description of what I did.

1. I clicked on the Dictionary icon in the Toolbar. LiveCode Dictionary appeared.

2. In the left column of the LiveCode Dictionary I clicked on the Language.

3. In the search field in the upper right corner i entered copy.

4. In the upper window I chose copy and in the lower window, under Examples I found: copy this card to stack "Project 1"

5. I clicked on the Message Box icon in the Toolbar, and in the upper small text field I entered copy this card. In the lower bigger text field of the message box I got true as confirmation that the card was now in the Clipboard.

6. In the message box, I entered paste in the upper small text field and pressed Enter, and the duplicate of the card was inserted in my stack.
uelandbob@gmail.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: How do you duplicate a card

Post by dunbarx » Mon Dec 29, 2014 5:14 pm

OK.

You are on your way. If you were familiar with HC (were you? it sounded like it), you are already familiar with LC. There are a few paradigm changes, for example, there are no backgrounds anymore, and menus are handled differently. But your learning curve is already half done.

Experiment, do the tutorials and lessons, write back here as often as you need to.

Craig

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: How do you duplicate a card

Post by Da_Elf » Tue Dec 30, 2014 12:59 am

"clone"
ive used it for groups and stacks and in the dictionary they have "clone this card"

In my POS there are a lot of groups i want to have access to but dont want to have to keep hiding and unhiding them or clearing them out before and after each use so i just make a clean version of the group in another card and clone it into the card im working in. This keeps the main card from having too many hidden groups in it and gives me a clean setup each time i clone it over then when im finished with it i delete it since its still saved in another card

uelandbob
Posts: 72
Joined: Mon Dec 29, 2014 3:28 pm

Re: How do you duplicate a card

Post by uelandbob » Tue Dec 30, 2014 10:52 am

Thank you Da_Elf, very useful technique :D
uelandbob@gmail.com

Post Reply