Re: [Q] how to anticipate last iteration in for .. in pairs
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [Q] how to anticipate last iteration in for .. in pairs
- From: Javier Guerra <javier@...>
- Date: Mon, 4 May 2009 10:10:01 -0500
On Mon, May 4, 2009 at 10:05 AM, V S P <toreason@fastmail.fm> wrote:
>
> Hello,
> what's a way to anticipate the last iteration
> in loop over a table
untested:
for k, v in pairs (t) do
if next(t,k) == nil then
-- it's the last
end
-- general body
end
--
Javier