comparison Utility.lua @ 104:9aa2dcbbdc87

Detect when an int is really a date and print it that way
author John@Yosemite-PC
date Sun, 06 May 2012 08:30:15 -0400
parents 790266dbcaff
children
comparison
equal deleted inserted replaced
103:d3ea0ab1428d 104:9aa2dcbbdc87
3 local tostring=tostring 3 local tostring=tostring
4 local type=type 4 local type=type
5 local table=table 5 local table=table
6 local getmetatable=getmetatable 6 local getmetatable=getmetatable
7 local setmetatable=setmetatable 7 local setmetatable=setmetatable
8 local _G=_G
8 9
9 setfenv(1,bsk) 10 setfenv(1,bsk)
10 11
11 -- These two functions properly format the call to AceConsole:Print(), which 12 -- These two functions properly format the call to AceConsole:Print(), which
12 -- needs a full object. Calling "Print" will call the mixed-in console functions 13 -- needs a full object. Calling "Print" will call the mixed-in console functions
46 if #depth > 3*5 then print(depth.."Recursion too deep - stopping"); return end 47 if #depth > 3*5 then print(depth.."Recursion too deep - stopping"); return end
47 for i,v in pairs(tabl) do 48 for i,v in pairs(tabl) do
48 if( type(v) == "string" ) then 49 if( type(v) == "string" ) then
49 print(depth .. i .. " - " .. v) 50 print(depth .. i .. " - " .. v)
50 elseif( type(v) == "number" ) then 51 elseif( type(v) == "number" ) then
51 print(depth .. i .. " - " .. tostring(v)) 52 if v > 1331000000 and v < 1349000000 then
53 print(depth .. i .. " - " .. tostring(v) .. " " .. _G.date("%m/%d/%y %H:%M:%S", v))
54 else
55 print(depth .. i .. " - " .. tostring(v))
56 end
52 elseif( type(v) == "table" ) then 57 elseif( type(v) == "table" ) then
53 --if v == table then return end 58 --if v == table then return end
54 print(depth .. tostring(i) .." - ") 59 print(depth .. tostring(i) .." - ")
55 if history then 60 if history then
56 for i,vh in pairs(history) do 61 for i,vh in pairs(history) do