View Single Post
05-25-10, 07:36 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
I assume you have tables listed in your TOC SavedVariables or SavedVariablesPerCharacter line ?

If so, the game automatically saves the values you store in those tables when you log out. And automatically loads them when you log in.

The simplest way to clear the table is to set it to {}.

So if your SavedVariable table was MySavedTable then you would do MySavedTable = {} to clear out the contents ready for adding new data to.

When you want to write to the table you would then do
MySavedtable = MySavedTable or {}
to use the loaded table or create a new one if it doesn't exist yet.

Then whatever you add to it will get saved. Remember though that if you wish to add another table to it you may need to repeat the process above for the sub table.
EG. MySavedTable[subTable] = MySavedTable[subTable] or {}

Otherwise simply writing MySavedTable.SavedVariable = SomeValue and MySavedTable[subTable].SubTableVariable = AnotherValue will mean it will get written to the WTF file.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote