Thread Tools Display Modes
05/08/14, 07:34 PM   #1
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
[outdated] A command/function to clear the savedVariables

A command/function that clears everything in a savedVariable file, it could be useful. We could include it in "defaults" button, for example, to clean the file up before re-initializing everything with default values.

Reasons: "released" variables stay in the file unless the add-on sets them to nil. An official, quick command to clean the savedVariable file up would be much more useful.
 
05/09/14, 01:55 AM   #2
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Originally Posted by lyravega View Post
A command/function that clears everything in a savedVariable file, it could be useful. We could include it in "defaults" button, for example, to clean the file up before re-initializing everything with default values.

Reasons: "released" variables stay in the file unless the add-on sets them to nil. An official, quick command to clean the savedVariable file up would be much more useful.
This is my function to clear SV.
Lua Code:
  1. function IRY:cls()
  2.     self.playerDatabase.data={}
  3.  
  4.     ReloadUI()
  5. end
 
05/28/14, 02:45 PM   #3
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
The simplest way to force the Cosntructor to ingore the current saved stuff and instead use the default is to increase the version you hand it. While normally you use a design time constant, nothing prevents you from making this a variable.
You just need a different namespace in the same file to store wich version was last used.
Each Namespace can have a different version given during accessing, so you can throw out one part of the data and leave the others intact (like those settings) intact.
 

ESOUI » Developer Discussions » Wish List » [outdated] A command/function to clear the savedVariables

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