lua-users home
lua-l archive

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

> If it's a numerical indexed table, I can use
> table.getn, but if the table is indexed by names, how
> to get it's size?

There is no simple call like table.getn.  If you just want to know if
a table is empty (the most likely application) you can use next:

    if next(t) == nil then
      -- t is empty