[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to determine true size of a table?
- From: Matt Campbell <mattc@...>
- Date: Thu, 02 Mar 2006 10:21:59 -0600
The only way I know to count non-indexed values in a table is like this:
function countFields(t)
local count = 0
for k, v in pairs(t) do
count = count + 1
end
return count
end
Does anyone have a better solution?
--
Matt Campbell
Lead Programmer
Serotek Corporation
www.freedombox.info
"The Accessibility Anywhere People"