This works well in corona simulator but doesn’t want to work on android device. What really confuses me is that it keeps saying global is nil, but my next if/then statement is also specific for a nil return, but it still comes up with an error. I’ve tried a handful of solutions but I’ll try them again if needed. Thanks in advance
[lua]
Group = {
Value = “”,
Input1 = “”
}
for k, v in pairs( Group ) do
print (k, v)
end
(NOTE: for the above, terminal reads:
Input1
Value
)
print (“Before loading Group.Value :(”…Group.Value…")")
(NOTE: for above, it reads “Before loading Group.Value :()” )
for k, v in pairs( Group ) do
print (k, v)
end
(NOTE: for the above, terminal reads:
Input1
Value
)
print ("**********")
Group = loadTable(“Group.json”)
print ("here "… Group.Input1)
(NOTE: ERROR happens here. Terminal reads, Lua Runtime Error: lua_pcall failed with status: 2, error message is: …sktop/App/main.lua:46: attempt to index global ‘Group’ (a nil value)
Also when I put in the pairs (Group) lines, I get the error reading
Lua Runtime Error: lua_pcall failed with status: 2, error message is: …sktop/App/main.lua:947: bad argument #1 to ‘pairs’ (table expected, got nil)
)
print ("here "…Group.Value)
if (Group.Value == nil ) then -----------> (if I take out the above error lines, it gets stuck here next with an error)
Value = 10
elseif (Group.Value ~= nil ) then
Value = Group.Value
end
–end [/lua]