[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: About the #(length) operator and table.getn
- From: "RJP Computing" <rjpcomputing@...>
- Date: Tue, 25 Mar 2008 17:08:41 -0400
On Tue, Mar 25, 2008 at 2:45 PM, Petite Abeille <petite.abeille@gmail.com> wrote:
Don't let that stop you! Write your own!
local function ForEach( aTable, aFunction )
for aKey, aValue in pairs( aTable ) do
aFunction( aKey, aValue )
end
end
ForEach( { a = 1, b = 2, c = 3 }, print )
> a 1
> c 3
> b 2
Or something!
Very cool. Great idea. Of coarse. Thanks for such a simple solution.
--
Regards,
Ryan