View Single Post
05/15/14, 06:38 AM   #3
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by Wobin View Post
#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
Hmm ok I see. Will have to create my own count() func then

Will try this and see how it works. Thanks !
  Reply With Quote