WoW Lua

Assigns a value to a key in the table, without invoking metamethods.

table = rawset (table, index, value)

Arguments Edit

table - any valid table.
non-nil - any valid table index.
any - any value.


table - the table you passed as the first parameter.

Example Edit

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.

Icon-shortcutSee also: metatables, rawget 

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.