View Single Post
05/15/14, 06:32 AM   #2
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
#table only works for consecutively assigned numerical indexes, so t = {"a", "b", "c"} or t={[1] = "a", [2] = "b", [3] = "c"}

As you're using itemIds as the index, you're ending up with nonconsecutive elements. Use pairs(t) to iterate through and count elements

Code:
local count = 0
for k in pairs(t) do count = count + 1 end

Last edited by Wobin : 05/15/14 at 06:35 AM.
  Reply With Quote