Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function var_dump(v,pad)
- pad = pad or ""
- local _t = type(v)
- if _t=="table" then
- local _k,_v
- local _r = ""
- for _k,_v in pairs(v) do
- _r = _r..pad.." ".._k.."="..var_dump(_v,pad.." ")..",\n"
- end
- if string.len(_r)>0 then
- return "{\n".._r..pad.."}"
- else
- return "{}"
- end
- elseif _t=="function" then
- return "function()"
- elseif _t=="string" then
- return "\""..v.."\""
- else
- return tostring(v)
- end
- end
Add Comment
Please, Sign In to add comment