Moving Value of Field to another field on another card/stack

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
kosmo01
Posts: 4
Joined: Tue Jun 17, 2014 6:57 pm

Moving Value of Field to another field on another card/stack

Post by kosmo01 » Wed Jun 18, 2014 7:12 pm

Is this the correct format to move the value of a field (substack) to another field on the main stack?

put field "field 1" into field "field 2" of card "card id 1002" of stack "Untitled 1"

I am getting a error that it can't find the card.

Thanks,
Kosmo

kosmo01
Posts: 4
Joined: Tue Jun 17, 2014 6:57 pm

Re: Moving Value of Field to another field on another card/s

Post by kosmo01 » Wed Jun 18, 2014 8:20 pm

Figured it out...

changed 'of card' to 'of the card'

Thanks,
Kosmo

SparkOut
Posts: 2948
Joined: Sun Sep 23, 2007 4:58 pm

Re: Moving Value of Field to another field on another card/s

Post by SparkOut » Wed Jun 18, 2014 8:22 pm

The problem you have is with the part:

card "card id 1002"

By enclosing in quotes you have made "card id 1002" a literal string, and so LC will be looking for a card named "card id 1002".

Try referring to the card name in quotes:

card "theCardName"

or refer to the id by id:

card id 1002

as in

Code: Select all

put field "field 1" into field "field 2" of card id 1002 of stack "Untitled 1"
This assumes that your fields are named "field 1" and "field 2"

Post Reply