table.getn

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

ExampleReturn entry count
Returns the entry count of a table.
Code
<nowiki>
t = { 5, 4, 2, 1, 3 }
table.getn(t)
    </nowiki>
Output
5

table.getn
Function
Syntax
table.getn(
  • table : table
)

Returns number
API table
Source Lua (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.