Quantcast API rawset - WoWWiki - Your guide to the World of Warcraft
Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

API rawset

From WoWWiki

Jump to: navigation, search

 


This is a Lua function and documented as part of the World of Warcraft API

Contents

Usage

This function does the same as table[index] = value, without invoking any metamethods.

table = rawset (table, index, value)

Parameters

Arguments

table 
table - any valid table.
index 
numeric - any valid table index.
value 
any - any value.

Returns

table 
table - the table you passed as the first parameter.

Example

mytable = { }
rawset(mytable, "version", 1.0)

Details

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.

Notes

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.

shortcut iconSee Also: metatables, rawget
Rate this article:
Share this article: