putting very large table in another file

Hi

I have all my code in a single main.lua file. My program will draw on a very large table of data to display questions and  answers on the screen. The table is called questions. Just for ease of use I’d like to put this table in another file but I’m not sure how to call it from the main.lua file. The main file has a function that needs access to the table’s size as it uses a loop that begins thus:  for c=1,#questions do

Here’s a bit of the table:

local questions = {  

   {question = “In what year was J.S. Bach born?”,    q1 = “1685”, q2 = “1750”, q3 = “1803”, answer=“Bach was born in Eisenach, Germany, in 1685.”, pic=“pics/jsb.jpg”}, 

… lots more questions…

   {question = “In what year was W.A. Mozart born?”,  q1 = “1756”, q2 = “1754”, q3 = “1800”, answer=“Mozart was born in Salzburg in 1756.”, pic=“pics/wam.jpg”},

}

thanks in advance.

move the question data to its own file

then at the end of the file put

return questions

then in main.lua at top add

local questions = require(“name_of_file”)

thanks, that did the trick. 

move the question data to its own file

then at the end of the file put

return questions

then in main.lua at top add

local questions = require(“name_of_file”)

thanks, that did the trick.