local a = {10, 20, 30, 40, 50, 60, 70}
local found = nil
for i=1,#a do
if a[i] == 30 then
found = i
break
end
end
print(found)
Wednesday, May 2, 2012
Loop example : find a value in a list
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment