I have a problem, I need to do the following:
I have a variable that holds a number (x = 3 for example)
And I have a table like this:
tabela={}
tabela.var1='teste1'
tabela.var2='teste2'
tabela.var2='teste3'
tabela.var2='teste4'
I need to access this table by typing tabela.var
with variable x
(in case 3), it would look like this
print(tabela.var..x)
But the value of tabela.var
is nil
. Is there any way to make it just after the concatenation the program reads as a variable?