0 Members and 2 Guests are viewing this topic.
a = {1,2}print(blocks[1]) --Should return "2", but returns "table: 0x1151460"
"blocks" ? Either I'm stupid, or I don't understand why you're trying to access to a nil table ...In the case you wrote "a" instead of "blocks", it should return "1", not "2" because the Lua is in base 1 (contrary to C/C++/PHP/etc ... in base 0)
a = {{1,2},{3,4}}print(#a)for i=0,i<(#a),i+1 do print(a[i][0])end
2lua: testing.lua:8: attempt to compare nil with numberstack traceback: testing.lua:8: in main chunk [C]: ?
a = {{1,2},{3,4}}print(#a)for i=0, #a do print(a[i][0])end
a = {{1,2},{3,4}}print(#a)for i, var in ipairs(a) do print(i.." : "..var)end