Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise. Lua base functions Lua bc (big number) functions Lua bit manipulation functions Lua coroutine functions Lua debug functions Lua io functions Lua LPEG library Lua math functions Lua os functions Lua package functions Lua PCRE regular expression functions Lua script extensions Lua string functions Lua syntax Lua table functions Lua utilities Scripting Scripting callbacks - pluginsĮnter a search string to find matching documentation. More downloadable patches and content like Spore. for i contestants, 1, -1 do if contestantsi then table.
#Lua table insert remove slow for free#
ncat - Concatenates table items together into a string table.foreach - Applies a function to each item in a table table.foreachi - Applies a function to each item in a numerically-keyed table table.getn - Returns the size of a numerically-keyed table table.maxn - Returns the highest numeric key in the table table.remove - Removes an item from a numerically-keyed table tn - Sets the size of a table (obsolete) table.sort - Sorts a table Download Spore Patch 5 v1.05 patch for Spore for free from the biggest game patches database of Spore. Another option is iterating from the back of the table, so when you remove an element it doesn’t change the unchecked element order. strings) you simply assign to the table item to insert it. The Lua authors recommend using the idiom "#t + 1" to insert to the end of a table nowadays. Any C library can store data into this table, but it should take care to choose keys different from those used by other libraries, to avoid collisions. This table is always located at pseudo-index LUAREGISTRYINDEX.
#Lua table insert remove slow code#
Table.insert (t, "jumped") - add to end of table Lua provides a registry, a pre-defined table that can be used by any C code to store whatever Lua value it needs to store. Table.insert (t, 2, "very") - new element 2 If called with 2 arguments, the value is inserted at n+1, that is, the end of the table. Thus the new element becomes the one with index 'pos'. Controversy surrounded Spore due to the inclusion of SecuROM, and its digital rights management software, which can potentially open the users computer to. Inserts the value at (optional) position 'pos', renumbering existing elements if necessary to make room. Inserts a new item into a numerically-keyed table