Re: Size of a non numerical indexed table
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Size of a non numerical indexed table
- From: Wim Couwenberg <wcou@...>
- Date: 2005年9月01日 15:19:11 +0200
I'm fairly certain it was an interaction with varargs - attempts to
iterate over the arguments failed because the iterators stopped whenever
they encountered a nil argument.
the ipairs generator will stop at the first nil. To safely iterate over
all arguments use:
for i = 1, select("#", ...) do
local a = select(i, ...)
-- etc...
end
or
local arg = {...}
for i = 1, select("#", ...) do
local a = arg[i]
-- etc...
end
--
Wim