I have this in menu.lua
local db = require "databaseconnection"
...
local function onEndBtnRelease()
local thisandthat = db.getLoggedIn()
native.showAlert( "Corona SDK", thisandthat.." teststring", { "OK" } )
end
...
and this in databaseconnection.lua
local function getLoggedIn()
print("Test")
--[[...
]]--
return "some data"
end
The only thing I want is that String ("some data"
) from getLoggedIn()
, but all I get is an error:
...\corona\menu.lua:51:attempt to call field 'getLoggedIn' (a nil value)
The outprint is never reached.
I'm working on Corona SDK and Sublime, the needed data from isLoggedIn()
comes from a sqlite-request. How can I reach that function?