Re: About the #(length) operator and table.getn
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: About the #(length) operator and table.getn
- From: Geoff Leyland <geoff_leyland@...>
- Date: 2008年3月26日 13:23:34 +1300
I think
local counter = 0
for _ in pairs(t) do counter = counter + 1 end
might be better (faster, simpler?)
Cheers,
Geoff
On 26/03/2008, at 1:13 PM, Raul Gerardo Huertas Paiva wrote:
So, to get the number of entries in a table y must do somethig like:
counter = 0;--The counter
function addcounter
counter = counter+1;
end
Foreach( tabla, addcounter) --PetitteVersion
???
Is this correct? :S