I have a table, called nameData = {}. I have data inserted into this table. I would like to replace this data and update nameData. But when I do this the table always stays the same with the original data. How would I replace the data with new table data and update the nameData table. Here is some code I use. I have tried to make the nameData file local also. But then it comes up as a nil. Any help would be appreciated. I am just starting with Corona. Here is some code that I load from my main lua file.
Table.lua
if tablePick == 1 then
nameData = {“Accountants”,“Airlines”,“Antiques”,“Appliances”,“Art Galleries”}
elsif tablePick == 2 then
nameData = {“Arcades”,“Bars”,“Billards Parlours”,“Bowling Alleys”}
endif
local function loadData()
for x = 1 , #nameData do
listRecs[x] = {}
listRecs[x].name = nameData[x]
end
end – loadData function