[Resolved] inserting a table into a table entry (SubTable)

myTable:insert(newTableItem) works.

myTable[1]:insert(newTableItem) doesn’t work.

what is the proper methodology to insert a table within a table entry?

I guess file this under ‘creating a subTable’ ,thanks for your help.
[import]uid: 100299 topic_id: 24255 reply_id: 324255[/import]

Did you instantiate myTable[1] ?

myTable[1] = {}
myTable[1]:insert(newTableItem)

[import]uid: 21331 topic_id: 24255 reply_id: 98031[/import]

Do I need to if it already exists as a table[1] ?

table[1] = {
item1=1, item2=1,item3=1}

insert a table into table[1] so it would be something like…

table[1] = { item1=1, item2=2, item3, subTABLE_I_Inserted }

[import]uid: 100299 topic_id: 24255 reply_id: 98037[/import]

If it is a table, I believe you do. Need to hit some tests, trying from memory. If you are still having issues when I get home, I’ll try to help. [import]uid: 21331 topic_id: 24255 reply_id: 98040[/import]

if it comes to you then great, but don’t fret it.

I just made a var in the first table to reference another table to work around it.

thanks!
[import]uid: 100299 topic_id: 24255 reply_id: 98042[/import]

table[1] = {item1=1, item2=1,item3=1}
table[2] = {}
table.insert(table[1], #table[1] + 1,table[2])

This seems ok… [import]uid: 21331 topic_id: 24255 reply_id: 98043[/import]

hey thanks! [import]uid: 100299 topic_id: 24255 reply_id: 98048[/import]