View Single Post
08-26-16, 06:12 PM   #2
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Lua Code:
  1. function PrintArray(array)
  2.     for k, v in pairs(array) do
  3.         if type(v) == "table" then
  4.             print(v, "contains:")
  5.             PrintArray(v)          
  6.         else
  7.             print(v)
  8.         end
  9.     end
  10. end

just call this function like this:
Lua Code:
  1. local a = {
  2.     {1,2,3},
  3.     {4,5,6},
  4.     {7,8,9},
  5.     [8] = "HELP",
  6.     [12] = {
  7.         ["MEW"] = true,
  8.         "foul",
  9.     },
  10. }
  11.  
  12. PrintArray(a)
__________________

Last edited by syncrow : 08-26-16 at 06:19 PM.
  Reply With Quote