Hi guys, as the topic said. How can i do it?
this is the codes i used for now.
Table(another module)
[lua]
local M = {}
local myTable = {
{question = yes?, answer = no}
}
[/lua]
Code for the Function module for calling the table:
[lua]
local Table = require(“Table”)
local M = {}
local function loadQuestions(questions)
local myTable = {}
local result
local questions
question = “SELECT * FROM myTable WHERE questions = ‘…questions…’;”
result = myTable
print ("query result: ", result.ques_no )
return result
end
loadQuestions( Table )
M.loadQuestions = loadQuestions
return M
[/lua]
Code for displaying the Text(another Module):
[lua]
gameQuestion = Function.loadQuestions(questions)
questions = (gameQuestion[“questions”])
answer = string.lower(gameQuestion[“answer”])
local gameDisplayQuestion = display.newText(questions,0,0,native.systemFont)
gameDisplayQuestion.x = 100 ; gameDisplayQuestion.y = 200
[/lua]
Is this the correct way to call a table and display the text ? Thanks in advance for helping