This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MarcoPolo0306's profile picture

Insert a table into a table?

Started by MarcoPolo0306, 14 May 2018 - 07:08 PM
MarcoPolo0306 #1
Posted 14 May 2018 - 09:08 PM
How do I insert a table into a table?
Thanks for any help!
SquidDev #2
Posted 14 May 2018 - 09:12 PM
Like you would any other value?

local a = {}
table.insert(a, {})

I suspect you want something more than that, in which case you might want to expand on your question a little.
Edited on 14 May 2018 - 07:12 PM
MarcoPolo0306 #3
Posted 14 May 2018 - 11:41 PM
Ok. Thanks!
Lupus590 #4
Posted 15 May 2018 - 12:11 AM
or


local tab = {}
tab.subTable = {}

--# or

local tab2 = {
  subTable = {}
}

Edited on 14 May 2018 - 10:12 PM