I think a lot of us would like to see some kind of “include” function. In php you can include another php file and its as if that file’s contents were right there in the first file.
Some of us with more complex code need a better way to organize things. Using modules isn’t the same as what I’m describing. fileA.lua included fileB.lua it would be as if all of fileB.lua was actually right in fileA.lua. The code in fileB would interact with code in fileA just like they were the same file. So if you declare local variable123 you could use the variable in fileB–assuming of course it was declared before the “include.”
This way you can slice up your code rather easy. Lets say you have a rather long section of code–say its for your pause menu or something. You could just cut that section of code and paste it into pausemenu.lua. Include the file where the code used to be and your good to go. This would make code much more organized.
The reason I’ve heard this can’t be done is that Apple won’t allow such things for security reasons–everything needs to be in one single file. I don’t understand this explanation at all–this doesn’t seem to be a problem with modules. Who cares if its one big file when it goes to Apple–you could have corona combine the files when the app is built. The purpose of this is just to organize code clearly so the developer isn’t lost in a growing sea of thousands of lines of code.
Anyone else like to see this? Seems like it’d be a very simple thing for Ansca to implement. It seems so basic that I’m shocked that Corona doesn’t already have something like this in place. Hopefully I’m just stupid, it actually does, and one of you can point it out to me. [import]uid: 94309 topic_id: 24609 reply_id: 324609[/import]