table.maxn
Returns the highest numeric key in the table
Prototype
n = table.maxn (t)
Description
Returns the highest numeric key in the table, by examining each entry in the entire table. This will necessarily be slower than doing table.getn, but would be needed if the keys have gaps in the sequence.
If the table does not have gaps in the keys, it is faster to use table.getn.
If the table does not have gaps in the keys, it is faster to use table.getn.
Lua functions
- table.concat - 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.insert - Inserts a new item into a numerically-keyed table
- table.remove - Removes an item from a numerically-keyed table
- table.setn - Sets the size of a table (obsolete)
- table.sort - Sorts a table
Topics
- Lua LPEG library
- Lua PCRE regular expression functions
- Lua base functions
- Lua bc (big number) functions
- Lua bit manipulation functions
- Lua coroutine functions
- Lua debug functions
- Lua io functions
- Lua math functions
- Lua os functions
- Lua package functions
- Lua script extensions
- Lua string functions
- Lua syntax
- Lua table functions
- Lua utilities
- Scripting callbacks - plugins
- Scripting