rawset(table, index, value) - Sets the value of a table item without invoking metamethods. rawget(table, index) - Gets the value of a table item without invoking metamethods. rawequal(value, value) - Compares two values for equality without invoking metamethods. xpcall(func, err) - Returns a boolean indicating successful execution of func and calls err on failure, additionally returning func's or err's results. (The only Lua data types.) unpack(table) - Returns the contents of its argument as separate values. time(table) - Returns time in seconds since epoch (00:00:00 Jan 1 1970) type(var) - Returns the type of variable as a string, "nil", "boolean", "number", "string", "table", "function", "thread" or "userdata". setmetatable(table, metatable) - Sets the metatable of the given table. setfenv(function or integer, table) - Sets the table representing the stack frame of the given function or stack level. select(index, list) - Returns the number of items in list or a subset of the list beginning at index and running to the end of the list. ) - Returns a boolean value indicating successful execution of func and the error message or func's results as additional values.
![lua table insert remove lua table insert remove](https://www.oreilly.com/library/view/creating-solid-apis/9781491986301/assets/csal_0101.png)
newproxy(boolean or proxy) - Creates a userdata with a sharable metatable. next(table, index) - Returns the next key, value pair of the table, allowing you to walk over the table.
#LUA TABLE INSERT REMOVE CODE#
loadstring("Lua code") - Parse the string as Lua code and return it as a function reference. getmetatable(obj, mtable) - Returns the metatable of the given table or userdata object. ) getfenv(function or integer) - Returns the table representing the environment of the given function or stack level. (Function gcinfo is deprecated use collectgarbage("count") instead. gcinfo() - Returns the number of kB of add-on memory in use and the current garbage collection threshold (in kB). error("error message",level) - Throws an error with the given error message.
![lua table insert remove lua table insert remove](https://image.slidesharecdn.com/thebasicsanddesignofluatable-170213091607/95/the-basics-and-design-of-lua-table-19-638.jpg)
difftime(t1, t2) - Calculate the number of seconds between time t1 to time t2. (Added in 1.10.1) date(format, time) - Returns the current date according to the user's machine. collectgarbage() - Forces garbage collection. If it is, returns value, otherwise causes a Lua error to be thrown.
![lua table insert remove lua table insert remove](https://www.codegrepper.com/codeimages/lua-split-string-by-delimiter.png)
In addition to this list, see also Debugging Functions.Īssert(value) - asserts a value evaluates to true. These functions are part of the Lua programming language (v5.1), described in the Lua 5.1 Reference Manual. Notably, operating system and file I/O libraries are not present. Note that the World of Warcraft API does not provide all standard Lua functions.