problem accessing data in modules

Hi all,
I'm so confused. I'm trying to store some data in an external module, leveldata.lua and trying to access that data from main.lua.

My code in main.lua is:

local leveldata = require("leveldata")
local ChuteWidth = leveldata.ChuteWidth
print("leveldata.ChuteWidth=",leveldata.ChuteWidth)

My code in leveldata.lua is:

module(..., package.seeall)
local ChuteWidth = { 76, 112, 67, 66 }

However the print statement indicates that leveldata.ChuteWidth is nil.

What stupid thing am I doing wrong?
Thanks,
-Dennis

You can use different approach to this
main.lua

1
2
3
4
5
local ext = require("external")
 
for i,v in pairs(ext.data) do
print(i,v)
end
views:1488 update:2012/1/15 11:04:51
corona forums © 2003-2011