Is it illegal to have the “module” statement at the top of main.lua?
–[[
main
–]]
module(…, package.seeall)
All I did was add that module statement and now I get the following error:
(Actually I just copied & pasted it from another file that generated no errors)
/Users/Caster/Data1/iDev/Corona Projs/TOT/main.lua:4: bad argument #1 to ‘module’ (string expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘module’
/Users/Caster/Data1/iDev/Corona Projs/TOT/main.lua:4: in main chunk
[import]uid: 295 topic_id: 1943 reply_id: 301943[/import]
I use that line all the time however I’ve never used it in my main file, this may be your problem. [import]uid: 5833 topic_id: 1943 reply_id: 5741[/import]
Why would you want to, main.lua isnt a module? [import]uid: 5354 topic_id: 1943 reply_id: 5744[/import]
Sorry but your question us helpful. I don’t want to explain. I just want to know if it can be done or not. [import]uid: 295 topic_id: 1943 reply_id: 5749[/import]
Then no it cant be done.
The reason I asked why you would want to do it is because if you have a specific problem that needs a solution and you can explain the problem then someone could probably offer a solution. [import]uid: 5354 topic_id: 1943 reply_id: 5750[/import]
Thanks.
Actually I had a few basic overall game control functions (e.g. gameOver(), winnerIs(), restartGame()) that I thought would be better in main.lua just for aesthetic reasons. And I wanted to call those functions from functions in other module files. I know the solution - don’t put those functions there, which I didn’t in the end.
I just wanted to know if It’s illegal to use a require statement in main.lua. Or if it’s a bug.
Sorry for not making my question more plain in the info I wanted. [import]uid: 295 topic_id: 1943 reply_id: 5794[/import]