lua-users home
lua-l archive

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



El 21/09/2005, a las 1:26, Brent Arias escribió:

How do I write a nested foreach, to print out these values:

goo = {{5,6}, {12,9}, {4,7}}

Thanks,

-Brent


for key1, value1 in pairs(goo) do
  for key2, value2 in pairs(value1) do
    print(value2) -- Change to whatever you want to do with the values
  end
end


Cheers,

--
Adrián Pérez
GPUL/CLUG member » http://gpul.org
"Experience is what you get when you don't get what you want." (Dan Stanford)


Attachment: PGP.sig
Description: Mensaje firmado digitalmente