View Single Post
06-19-12, 11:05 AM   #13
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
try this to append items to your table so it will be "unpack"able

so put your table as 1st arg and values to add as 2nd, 3rd, ...

Code:
 tAppend = function( myTable, ... )
     myTable = { unpack( myTable ), ... }
 end
and this for the size if # don't work

Code:
 tSize = function( myTable )
    local temp = { unpack ( myTable ), "EndOfMyTable" }
    return #temp - 1
 end
or if that doesn't work then
Code:
 tSize = function( myTable )
    local temp = { unpack ( myTable ), "EndOfMyTable" }
    local x = 1
    while true do
         if type(temp[x]) == "string" and temp[x] == "EndOfMyTable" then
             return x - 1
         end
         x = x + 1
     end
 end
  Reply With Quote