View Single Post
01-06-19, 01:19 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
addon.toc
Code:
...
File1.lua
File2.lua
File1.lua
Code:
local _, Core = ...
Core.Hello = "Hello from file 1"
File2.lua
Code:
local _, Core = ...
print(Core.Hello)
prints "Hello from file 1"


The table (Core in this case) is created by the game and passed to each .lua file, it is not global. It can only be seen by other .lua files in the same addon (not xml files). The table starts off empty but your addon can use it as you see fit.

You don't "return" anything from the file, "function" was used to describe those arguments you may see in wow .lua files where ... seemingly appears "out-of-the-blue" rather than as actual function parameters
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote