lua-users home
lua-l archive

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


On 15 September 2013 12:15, IntelliAdmin Support
<support@intelliadmin.com> wrote:
>
> It only counts to the first nil, and stops.
>

This isn't entirely correct, in a table with holes the # operator can
return _any_ n where t[n] ~= nil and t[n+1] == nil. It is not
guaranteed to be the first hole.

You can maintain a count yourself, or avoid putting holes in your tables.

Cheers,
Josh.