How can I build a container ? [Solved]

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
atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

How can I build a container ? [Solved]

Post by atout66 » Mon May 12, 2014 3:43 pm

Hi to all,

Is there a way in LC to build a container so I don't have to write a long piece of words all the time ?
The code below is NOT OK while compiling in the editor code

Code: Select all

put card "myCard" of stack "myStack" into laCard
The var <laCard> is supposed to let me reference a field "myField" just like that:

Code: Select all

get fld "myField" of laCard
Instead of :

Code: Select all

get fld "myField" of card "myCard" of stack "myStack" -- which is correct but too long to write
Any idea around ?
Thanks in advance, Jean-Paul.
Last edited by atout66 on Mon May 12, 2014 5:01 pm, edited 1 time in total.
Discovering LiveCode Community 6.5.2.

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

Re: How can I build a container ?

Post by Klaus » Mon May 12, 2014 4:04 pm

Bonjour jean-Pau,

you can use "the long ID of ..."!
...
put the long ID of card "myCard" of stack "myStack" into laCard

## If you'd like to see what that gives :D
## answer laCard
...

Then access its content like you already wrote:
...
put fld "myField" of laCard into tVariable
...

Best

Klaus

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: How can I build a container ?

Post by atout66 » Mon May 12, 2014 5:01 pm

Klaus, your post number 5900 is "excellent". :wink:
Didn't know this feature <long ID>...

Thanks for your help, Jean-Paul.
Discovering LiveCode Community 6.5.2.

Post Reply