Lore archive · Warcraft Wiki, 2023 dump
API rawset
Last wiki revision 2022-08-03
Assigns a value to a key in the table, without invoking metamethods. table = rawset (table, index, value)
- table:table - any valid table.
- index:non-nil - any valid table index.
- value:any - any value.
- table:table - the table you passed as the first parameter.
mytable = { } rawset(mytable, "version", 1.0)
- Sets the real value of table[index] to value, without invoking any metamethod. table must be a table, index any value different from nil, and value any Lua value.
- Metamethods can be used to change the way LUA works with certain variables. For example you could change what LUA does if you set a tables index to a new value. By using rawset you can set an index without invoking these methods, which is primarily usefull in the metamethod that actually sets the tables index to value, otherwise this metamethod would invoke itself over and over again.
Source
https://warcraft.wiki.gg/wiki/API_rawset · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.