Posted 06 October 2015 - 09:19 PM
How can i print the content of a nested table without knowing the indexes and eventual nil entries in between?
If I'm not wrong in earlier versions it was possible to just "print(table())" and get a representation of the table.
But if I do that I'm only getting "table: 1f7da2b4".
So I looked around the web and it was suggested to use table.concat.
In lua terminal i get "lua:1: bad argument: string expected, got table) (Command: "table.concat(p.getAllStacks()" )
This didn't work, so I wrote this code:
So how would I do this?
If I'm not wrong in earlier versions it was possible to just "print(table())" and get a representation of the table.
But if I do that I'm only getting "table: 1f7da2b4".
So I looked around the web and it was suggested to use table.concat.
In lua terminal i get "lua:1: bad argument: string expected, got table) (Command: "table.concat(p.getAllStacks()" )
This didn't work, so I wrote this code:
p = peripheral.wrap("right")
list = p.getAllStacks()
for i, v in ipairs(list) do
for a, b in ipairs(v) do
write(a)
write(" ")
write(B)/>
end
end
But it doesn't output anything (not even an error).So how would I do this?