Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API RegisterForSave
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} {{protectedapi|1.10.0|}} This function is deprecated, use the .toc-file. Put in a line like ## SavedVariables: name1, name2, ... or: ## SavedVariablesPerCharacter: name1, name2, ... == Old documentation == <!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> RegisterForSave("variable"); Registers the named variable to be saved when the client shuts down (or the UI is reloaded) in the <tt>SavedVariables.lua</tt> file, so that its value will be loaded when the UI engine is restarted. '''IMPORTANT:''' Use of this has been largely deprecated in favor of the <tt>SavedVariables:</tt> tag in the AddOn's .toc file, see the details section below for reasons why. (Both mechanisms can be used, either of them simply flag the variable for saving). ---- ;''Arguments'' :("variable") :;variable : String - The name of the variable to save. ---- ;''Details'' :The new SavedVariables mechanism in the AddOn's .toc file is preferred to using this function because it will work even if the AddOn has been temporarily deactivated, or if it fails to load. :Using RegisterForSave instead is problematic if deactivation or an error prevents the function from executing, because even though the variable will be loaded when the engine starts, it wont be registered afterwards and so when the engine shuts down again, the value will be lost. :Don't use dynamically generated variable names, it's just a mess for other people to deal with. If you dont know which values you'll need ahead of time, make them all values within a single table variable.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Ambox
(
edit
)
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Protectedapi
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)