Use fields and data from other cards and substacks

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Use fields and data from other cards and substacks

Post by no1g8tor »

I may have just missed it in the docs, but how do you get data from another card and other substacks.

Example: I have a mainstack that need to retrieve data from some fields on a sub stact that contains settings for the whole program.

My if then statement would look something like this....


if field 1 is "1" and field 2 is "A" then ... Get the data from substack "data" card "race 1" field "race info"

Thanks
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark »

Get the data from substack "data" card "race 1" field "race info"
You got it almost right, no1g8tor:

get fld "race info" of cd "race 1" of stack "data"

or

put fld "race info" of cd "race 1" of stack "data" into myVar

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
no1g8tor
Posts: 62
Joined: Fri Nov 23, 2007 3:01 pm

Post by no1g8tor »

Thanks, I am learning.
Post Reply