copy field then delete 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
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

copy field then delete card

Post by herbwords » Sun Jun 26, 2011 7:02 pm

Hi to All,

I'm trying to copy the contents of a field from a card to a field on another card then delete the card (1st card) that I got the info from. Any suggestions on a script? Should the script be in the openCard of the card that's being deleted or the card that the info is being transferred to or somewhere else?

Thanks,

Patrick

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

Re: copy field then delete card

Post by dunbarx » Mon Jun 27, 2011 2:02 am

This is straightforward.

...
Put field "sourceField" into field "targetField" of cd "otherCard"
delete card "theCardWithFieldTargetFieldOnIt"

Note that you cannot delete a card if the handler resides on an object on that card. So you will have to do it from, say, the stack script. You will want to get the card id or some other reference so you can delete the right one.

Post Reply