View Single Post
08-08-13, 10:15 PM   #4
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
If that is the case something like that should work:

Lua Code:
  1. Window.mt.__tostring = function(o)
  2.     local str = ""
  3.     for k in pairs(Window.prototype) do
  4.         str = str .. k ..  " " .. o[k] .. "\n"
  5.     end
  6.     return str
  7. end

Then a simple print(w) should do it. Note that string concatenation is not efficient and you should probably use string.format instead. Also the order returned is random.
  Reply With Quote