lua-users home
lua-l archive

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

 table.foreachi (goo, function(index, value)
	-- you might want to check that "value" is of type "table" here
	table.foreachi (value, function(index, value)
		print(index, value)

same works with table.foreach as well but since goo is indexed by numbers only i figured foreachi is more appropriate

----- Original Nachricht ----
Von:     Brent Arias <>
Datum:   21.09.2005 01:26
Betreff: nested foreach

> How do I write a nested foreach, to print out these values:
> goo = {{5,6}, {12,9}, {4,7}} 
> Thanks,
> -Brent