Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-03-09, 11:51 AM   #1
Ne0nguy
A Fallenroot Satyr
 
Ne0nguy's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 22
Post Question about this variable usage

I have been looking though an addon called BlackList, which the author seems to have abandoned.

The following is all working code... I just have no idea how it is possible:
In the TOC the only saved variable is BlackListConfig:
Code:
(7)	## SavedVariables: BlackListConfig
After VARIABLES_LOADED fires, this runs:
Code:
(54)	if ( not BlackListConfig ) then
(55)		 BlackListConfig = {};
(56)	end
(57)	
(58)	if ( not BlackListConfig[REALM] ) then
(59)		BlackListConfig[REALM] = {};
(60)	end
(61)	
(62)	if ( not BlackListConfig[REALM].blackList ) then
(63)		BlackListConfig[REALM].blackList = {};
(64)	end
(65)	
(66)	_blackList = BlackListConfig[REALM].blackList;
After this point there is no significant reference to "BlackListConfig[REALM].blackList". All changes and additions to the database use "_blackList". Yet all the changes that are made to _blackList are saved and loaded between sessions.

Is there anything special about the naming convention that allows this to happen? There is no direct code copying the contents of _blackList back to BlackListConfig[REALM].blackList at any time.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Question about this variable usage


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