Copy card from one file 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
davidmills
Posts: 16
Joined: Tue Jan 13, 2015 1:21 am

Copy card from one file to another

Post by davidmills » Sat Jan 17, 2015 10:20 am

Try as I may to find what appears to be a simple task, I'm just not finding the answer on my search on Google and here.
I now realise I probably should have created two stacks in one file for testing two related projects and not one stack in two files.
Dave

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

Re: Copy card from one file to another

Post by Klaus » Sat Jan 17, 2015 12:52 pm

Hi David,

sorry, not the slightest idea what you are after!? 8)


Best

Klaus

davidmills
Posts: 16
Joined: Tue Jan 13, 2015 1:21 am

Re: Copy card from one file to another

Post by davidmills » Sat Jan 17, 2015 1:56 pm

Wow Klaus. There was me thinking it should be easy to do a card copy and I'm incapable of explaining my requirement to the members here and so guess I'm doomed with LC.
I have two LC Applications (should not have called them files) for use on an Android and I'm using a Windows 7 PC running LC Community 7.0.1.
one LC Application is named File1.livecode
the other LC Application is named file2.livecode
I want to copy a card and all it's contents from File2.livecode to File1.livecode which I thought would be a copy and paste.
If I was doing this card copy in a single application I would use the Message Box with 'clone this card'.
I think I have now explained my requirement.
Dave

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

Re: Copy card from one file to another

Post by Klaus » Sat Jan 17, 2015 2:01 pm

Hi Dave,

you are not doomed, promised :D
OK, open both stacks and then you can do this in the message box or with a button:
...
copy cd "name of cd 2 copy" of stack "file2" to stack "file1"
...

"CLONE" will create copy of a card, but in the SAME stack!


Best

Klaus

davidmills
Posts: 16
Joined: Tue Jan 13, 2015 1:21 am

Re: Copy card from one file to another

Post by davidmills » Sat Jan 17, 2015 2:11 pm

Thanks Klaus and also for the clone tip.
Why is it - copy cd "name of cd 2 copy" of stack "file2" to stack "file1" and to use 'cd' and not use 'card''?
Dave

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

Re: Copy card from one file to another

Post by Klaus » Sat Jan 17, 2015 2:15 pm

"Lazy moi" is using abbreviations whenever possible! :D

cd = card
btn = button
fld = field
grc = graphic
sb = scrollbar
etc...

davidmills
Posts: 16
Joined: Tue Jan 13, 2015 1:21 am

Re: Copy card from one file to another

Post by davidmills » Sat Jan 17, 2015 2:22 pm

Thanks again.
Dave

Post Reply