diff --git a/examples/usertype_simple.cpp b/examples/usertype_simple.cpp index e2dcbfe8..4a50839f 100644 --- a/examples/usertype_simple.cpp +++ b/examples/usertype_simple.cpp @@ -66,14 +66,14 @@ g.data = mdata.third list3 = g:generate_list() print("From lua: ") -for i, v in pairs(list1) do - print("\tlist1[" .. i .. "] = " .. v) +for i, v in list1 do + print("\tlist1[" .. i .. "] = " .. list1[i]) end -for i, v in pairs(list2) do - print("\tlist2[" .. i .. "] = " .. v) +for i, v in list2 do + print("\tlist2[" .. i .. "] = " .. list2[i]) end -for i, v in pairs(list3) do - print("\tlist3[" .. i .. "] = " .. v) +for i, #t in list3 do + print("\tlist3[" .. i .. "] = " .. list3[i]) end )");