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.

Lua functions

Topics