local a = {Mustaine = "Megadeth", Hetfield = "Metallica", King = "Slayer", Yngwie = "Rising Force"}
print ("--next--------------------------------------")
do
local k, v
k, v = next(a, nil)
while k do
print(k, v)
k, v = next(a, k)
end
end
print ("--pairs--------------------------------------")
do
for i, v in pairs(a) do
print(i, v)
end
end
Sunday, May 13, 2012
Looping
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment