Talk:Table.size

From Multi Theft Auto: Wiki
Revision as of 14:19, 13 July 2009 by NeonBlack (talk | contribs)
Jump to navigation Jump to search

What about using the builtin lua function:

table.getn(table)

--Subenji99 06:54, 13 July 2009 (CEST)


table.getn was replaced by the #-operator, which returns the number of table elements with a numerical (!) index.
table.size counts all elements regardless of which type their index is.
Of course it's a bad idea to use this function for a table with only numerical indices.
NeonBlack 16:19, 13 July 2009 (CEST)