table.getn

From ComputerCraft
Jump to: navigation, search

table.getn
Function
Syntax
table.getn()
Returns number
API table
Source Lua (source)

Returns the number of entrys in a table, until the first nil value.

ExampleExampleReturn entry count
Returns the entry count of a table.
Code
t = { 5, 4, 2, 1, 3 }
table.getn(t)
Output
5