Greyman27

table dump function

Apr 3rd, 2024 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | Software | 0 0
  1. function dump(o)
  2.    if type(o) == 'table' then
  3.       local s = '{ '
  4.       for k,v in pairs(o) do
  5.          if type(k) ~= 'number' then k = '"'..k..'"' end
  6.          s = s .. '['..k..'] = ' .. dump(v) .. ','
  7.       end
  8.       return s .. '} '
  9.    else
  10.       return tostring(o)
  11.    end
  12. end
Add Comment
Please, Sign In to add comment