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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

copy field then delete card

Post by herbwords »

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: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: copy field then delete card

Post by dunbarx »

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