Just invert your declaration:
function AskQuestion()
return "What do you want to know?"
end
my = {
Question = AskQuestion()
}
Since Lua is interpreted you have to have everything defined before you can use.
When setting a variable you don't need to pass the (vAnswer) because it is not a defition, it is just a existing-function usage, so change to:
function MyAnswer(vAnswer)
if vAnswer == "42" then return "Life.." end
end
my = {
Answer = MyAnswer
}
I am assuming here that you are using a different my
table, but you should get the picture.