WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Beginner Question: "a,b = ..." At beginning of File (https://www.wowinterface.com/forums/showthread.php?t=57043)

fakesaint41 03-07-19 06:31 PM

Beginner Question: "a,b = ..." At beginning of File
 
Been looking for an explanation, and I'm a bit stumped! I see something like:

Lua Code:
  1. local a, b = ...

at the beginning of people's scripts. I guess that WoW passes arguments to the chunk when it loads the file, but I'm not clear what those are and why they are useful. The first argument appears to be the name of the addon, and the second is a table of... something I don't know! :eek:

Can anyone explain whats going on here and why its useful?

Thanks!

Tim 03-07-19 06:42 PM

The table you're referring to is called the Namespace. It's an environment where you can store tons of variables which you can access throughout your addon. Here is a thread with thorough explanations and examples so that I don't have to. :P

fakesaint41 03-07-19 07:05 PM

Quote:

Originally Posted by Tim (Post 331637)
The table you're referring to is called the Namespace. It's an environment where you can store tons of variables which you can access throughout your addon. Here is a thread with thorough explanations and examples so that I don't have to. :P

Exactly what I was looking for thanks!


All times are GMT -6. The time now is 06:57 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI