Hi Everyone, my first Corna project is going well thanks to the generous guys on the forum.
My project consists of several screens (lua files) and I have tables that need to be used in each of them. Instead of declaring these tables locally in each of the lua files, I would like to centralise the table declarations to another lua file as global variables and then "require" them into the screen files. This way everytime I change a table, I won't have to update it in every lua file.
I have seen examples of using functions within external lua files but how would I retrieve table data.
For example, I create a lua file called test.lua and my table is
local table1 = {
{ name = "111", type = "1"},
{ name = "222", type = "2"},
{ name = "333", type = "3"}
}
I know I need to
test1 = require ("test")
How would I retrieve the table data? Would it be test1.table1.name or test1.name? Or am I miles off?
Thanks
Adrian