[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: iterating and calling functions in lua tables
- From: "Jim Whitehead II" <jnwhiteh@...>
- Date: Sun, 21 Dec 2008 10:55:28 +0000
On Sun, Dec 21, 2008 at 10:46 AM, Wim Couwenberg
<wim.couwenberg@gmail.com> wrote:
>> How can I iterate through this table, in the order the functions were added,
>> and call each function in turn.
>
> local functions = {f1, f2, f3, f4, f5, f6}
>
> for f in ipairs(functions) do
> f()
> end
>
I suspect you meant:
for idx,f in ipairs(functions) do
f()
end