Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
f4a963760a |
@@ -326,6 +326,26 @@ function strsplit(inputstr, sep)
|
|||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param table table
|
||||||
|
---@param depth number?
|
||||||
|
function DumpTable(table, depth)
|
||||||
|
if depth == nil then
|
||||||
|
depth = 0
|
||||||
|
end
|
||||||
|
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
|
||||||
|
|
||||||
-- String to number conversion helper
|
-- String to number conversion helper
|
||||||
function num(str)
|
function num(str)
|
||||||
return tonumber(str) or 0
|
return tonumber(str) or 0
|
||||||
|
Reference in New Issue
Block a user