Is there a better way to see if my table exists?
Basicly I have a table that resembles this:
table = { { {0 },{0,1},{0 },{0,1} }, { {0,1},{1 },{0,1},{1 } }, { {0 },{0,1},{0 },{0,1} }, { {0,1},{1 } }, { {0 }, }, { {0,1},{1 },{0,1},{1 } }, { {0 },{0,1},{0 },{0,1} }, { {0,1},{1 },{1 } }, }
except that the real table has more random and longer sets of 0s and 1s.
These strings of 0s and 1s are also dynamic and may or may not exist
Currently before I do an action I do an if then check like:
if table[3] and table[3][2] and table[3][2][3] then --do awesome things like: table[3][2][3] = table[3][2][3] + 1 end
So, is that the best way to ensure this value exist before manipulating it?
Thanks,
Gullie