lua-users home
lua-l archive

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

Ah, yours look better than mine - i had reversed my test condition for some reason.

On Mon, May 4, 2009 at 5:10 PM, Javier Guerra <> wrote:
On Mon, May 4, 2009 at 10:05 AM, V S P <> wrote:
> Hello,
> what's a way to anticipate the last iteration
> in loop over a table


for k, v in pairs (t) do
  if next(t,k) == nil then
     -- it's the last
  -- general body