lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I’m very new to Lua.

 

I’ve got an object (table) called g_flyer_pages  but I don’t know what’s in it.

So, I did this:

      for k,v in pairs(g_flyer_pages[1]) do

            print(k .. "=" .. tostring(v))

      end

 

which nets me this:

 

deals=table: 00BC08B0

 

 

So now I’m trying this:

 

      for k,v in pairs(g_flyer_pages[1]) do

            for k2,v2 in pairs(v) do

                  print(k2 .. "=" .. tostring(v2))

            end

      end

 

which nets me this:

 

1=table: 00926550

2=table: 00914B08

3=table: 00924170

4=table: 00927930

5=table: 009717C0

6=table: 00967D30

7=table: 00977190

8=table: 00979748

9=table: 009644F8

 

So finally this:

      for k,v in pairs(g_flyer_pages[1]) do

            for k2,v2 in pairs(v) do

                  for k3,v3 in pairs(v2) do

                        print(k3 .. "=" .. tostring(v3))

                  end

            end

      end

 

 

Which gets me some recognizable data. Is there no easier way to examine a nested table?

 

 

 

Dave Collins

Front-End Engineer

Mercatus Technologies Inc.
60 Adelaide Street East, Suite 700
Toronto ON M5C 3E4
T  416 603 3406 x 298
F  416 603 1790

 

dave.collins@mercatustechnologies.com

www.mercatustechnologies.com