View Single Post
01-12-15, 12:20 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
Unless the entry you're referring to in the addon table is another table, you'll just get a copy of the value, not a link to the entry. This is just how Lua stores tables and other complex value types as opposed to the basic types (numbers, strings, boolean, and nil).



To further explain this, I'll break down how Lua process something like this:
Code:
MyAddOnTable.MyVar
  1. Lua sees the name MyAddOnTable and finds it as a table in the list of registered locals.
  2. Lua finds the indexing operator "." and expects the following text to be an index.
  3. Lua sees MyVar and looks at the table entry which that string index points to.



What this means is MyVar isn't a variable in the way we usually see one. It's a table entry while MyAddOnTable is the actual variable in the statement.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 01-12-15 at 12:29 AM.
  Reply With Quote