Skip to content

Instantly share code, notes, and snippets.

@x5gtrn
Created October 25, 2009 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x5gtrn/217863 to your computer and use it in GitHub Desktop.
Save x5gtrn/217863 to your computer and use it in GitHub Desktop.
test of generic for, ipairs()
local array = {["key1"] = 1, key2 = 2; 3, 4, 5; key3 = 6; 7, 8}
print("array size=" .. #array)
for i,v in ipairs(array) do
print("index=" .. i
.. " value=" .. v)
end
print("value of key1=" .. array.key1)
print("value of key2=" .. array.key2)
print("value of key3=" .. array.key3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment