WoW:USERAPI tinsertbeforeval: Difference between revisions

m
→‎Code: Fixed tremovebyval
(Added a short to tcount in case the specified table is an array.)
m (→‎Code: Fixed tremovebyval)
Line 60: Line 60:
   -- tremovebyval: remove a table row given its value
   -- tremovebyval: remove a table row given its value
   function ''<PREFIX>''_tremovebyval(tab, val)
   function ''<PREFIX>''_tremovebyval(tab, val)
     for k,v in tab do
     for k,v in pairs(tab) do
       if(v==val) then
       if(v==val) then
         table.remove(tab, k);
         table.remove(tab, k);
Anonymous user