Hi, I have a LUA newbie problem.
I read the LUA tables tutorial at : http://lua-users.org/wiki/TablesTutorial
and read the Corona SDK document on Tables & Arrays at : http://developer.coronalabs.com/content/tables-arrays
but still can’t do what I need to do. I am hoping a kind soul here can point me in the right direction
I have a table of tables defined as :
local fields = {}
fields = {
{“123”},
{“red”},
{“apple”}
}
I can traverse this table using fields[counter][1] approach.
numElements = #fields tell me how many table elements there are in my mother table. Life is good so far!
Now I want to insert new table elements into fields. So I try
table.insert(fields, [numElements+1][1], {“test”} )
But it will not budge! Any help into programmatically inserting new table elements into my table will be much much appreciated.
Thank you very much.
Regards,
Kerem