Thread Tools Display Modes
03-07-19, 06:31 PM   #1
fakesaint41
A Murloc Raider
Join Date: Mar 2019
Posts: 7
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!

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

Thanks!
  Reply With Quote
03-07-19, 06:42 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
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
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
03-07-19, 07:05 PM   #3
fakesaint41
A Murloc Raider
Join Date: Mar 2019
Posts: 7
Thumbs up

Originally Posted by Tim View Post
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!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Beginner Question: "a,b = ..." At beginning of File

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