Minor Lua cleanup

This commit is contained in:
Luca 2018-05-30 22:34:26 +02:00
parent f83797b141
commit f67849e5b9
3 changed files with 105 additions and 50 deletions

View file

@ -1808,10 +1808,10 @@ end
-- The other two parameters should not be set
function tprint(s, l, i)
l = (l) or 1000; i = i or "";-- default item limit, indent string
if (l<1) then io.write("ERROR: Item limit reached.\n"); return l-1 end;
if (l<1) then print("ERROR: Item limit reached.<br>\n"); return l-1 end;
local ts = type(s);
if (ts ~= "table") then io.write(i..' '..ts..' '..tostring(s)..'\n'); return l-1 end
io.write(i..' '..ts..'\n');
if (ts ~= "table") then print(i..' '..ts..' '..tostring(s)..'<br>\n'); return l-1 end
print(i..' '..ts..'<br>\n');
for k,v in pairs(s) do
local indent = ""