lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


thank you, I'm new and I've don't see yet all the 'events' in the metatables. Thanks you all. bye!

On Tue, Mar 25, 2008 at 7:23 PM, Geoff Leyland <geoff_leyland@fastmail.fm> wrote:
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