field.text in a table

I have several text fields:

Uno = display.newText( “Uno”, 100, 465, “Helvetica”, 24)

Uno:setTextColor(0,0,0)

Dos = display.newText( “Dos”, 100, 659, “Helvetica”, 24)

Dos:setTextColor(0,0,0)

Tres = display.newText( “Tres”, 100, 853, “Helvetica”, 24)

Tres:setTextColor(0,0,0)

If I wanted to change the text content individually, I could do this:

Uno.text= “Cuatro”

Dos.text= “Cinco”

Tres.text=“Seis”

Another way would be to do it through a table.

How do I build a table to access the text content?

It does not work like this:

Tabla={Uno.text,Dos.text,Tres.text}

Tabla={Uno,Dos,Tres} -- store references to text fields in table print(Tabla[1].text) -- prints text from Uno text field print(Tabla[2].text) -- prints text from Dos text field

Perfect !

Tabla={Uno,Dos,Tres} -- store references to text fields in table print(Tabla[1].text) -- prints text from Uno text field print(Tabla[2].text) -- prints text from Dos text field

Perfect !