Quantcast Include files - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-12-18, 01:44 AM   #1
doofus
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 126
Include files

Hello guys

I have a rather large addon which is in a single .lua file, and it has about 15,000 lines and it is hard to navigate. Because lua variables are global I precede them with "local" so they can only be seen in my own file and avoid namespace issues with other addons. Because everyting is in one .lua file I do not have to worry about declarations of functions and variables and only make sure I declare them in the right order.

I want to split this large .lua file into smaller files just for ease of editing purposes.

In C/C++ I would simply do, #include "file1.c". With the "#include" the C compiler simply merges source files together as one might do by hand. file1.c would not compile on its own of course, it is just a convenient way to split a large source code file into chunks without worrying too much about externs and linkage.

That is in the C world. Is there a way to do the same in wow's lua?

thanks
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Include files

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off