Last active
October 12, 2023 03:55
-
-
Save Aedda/f7ce73e567636a3b7c90 to your computer and use it in GitHub Desktop.
Lua Table Dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dumpTable(table, depth) | |
if (depth > 200) then | |
print("Error: Depth > 200 in dumpTable()") | |
return | |
end | |
for k,v in pairs(table) do | |
if (type(v) == "table") then | |
print(string.rep(" ", depth)..k..":") | |
dumpTable(v, depth+1) | |
else | |
print(string.rep(" ", depth)..k..": ",v) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment