Page 1 of 1

Accesing tables within tables

Posted: Tue Feb 12, 2013 8:10 pm
by tolkien
One simple question:

Can I have a table
t1 = {boo = true, foo = false]

include that table within another table

t2 = {x=0, y=0, t1}

???

How do access to all members in t2?

Hope you understand.

Re: Accesing tables within tables

Posted: Wed Feb 13, 2013 12:41 am
by tolkien
Well...I can do:

t1 = { x=0, y=0, t2={boo=false,foo=true}}

And acces the member

T1.x = 10
T1.t2.boo = true

But when using large tables can be a mess use this form. I wonder if I could use it like I said in my orevious post.

Thanks friends.

Re: Accesing tables within tables

Posted: Wed Feb 13, 2013 1:31 am
by Mazze
t1 = { x=0, y=0}
t1.t2={boo=false,foo=true}
DebugPrint(t1.t2.foo)

Re: Accesing tables within tables

Posted: Wed Feb 13, 2013 8:34 am
by tolkien
Thanks! So obvious....that is of much help!