title: Length of nested array lua
body: <p>I am having trouble figuring out how to get the length of a matrix within a matrix within a matrix (nested depth of 3). So what the code is doing in short is... looks to see if the publisher is already in the array, then it either adds a new column in the array with a new publisher and the corresponding system, or adds the new system to the existing array publisher</p>
  
  <p><code>output[k][1]</code> is the publisher array
  <code>output[k][2][l]</code> is the system</p>
  
  <p>where the first [] is the amount of different publishers
  and the second [] is the amount of different systems within the same publisher</p>
  
  <p>So how would I find out what the length of the third deep array is?</p>
  
  <pre><code>function reviewPubCount()
      local output = {}
      local k = 0
      for i = 1, #keys do
          if string.find(tostring(keys[i]), '_') then
              key = Split(tostring(keys[i]), '_')
              for j = 1, #reviewer_code do
                  if key[1] == reviewer_code[j] and key[1] ~= '' then
                      k = k + 1
                      output[k] = {}
                     -- output[k] = reviewer_code[j]
                      for l = 1, k do
                          if output[l][1] == reviewer_code[j] then
                              ltable = output[l][2]
                              temp = table.getn(ltable)
                              output[l][2][temp+1] = key[2]
                          else
                              output[k][1] = reviewer_code[j]
                              output[k][2][1] = key[2]
                          end
                      end
                  end
              end
          end
      end
      return output
  end
  </code></pre>
  
  <p>The code has been fixed here for future reference: <a href="http://codepad.org/3di3BOD2#output" rel="nofollow">http://codepad.org/3di3BOD2#output</a></p>