Talk:Table.size
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)
Indded, I actually just attempted it with non-numerical indices and found it didn't work. I stand corrected. :D
I shall leave my humiliation (lol) here so anyone else wondering what the point of this function would be can see that it is for non-numerical indices. --Subenji99 20:43, 13 July 2009 (CEST)