1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-19 05:32:55 +00:00

Feedback from dan200

This commit is contained in:
Wilma456 2017-06-29 16:18:13 +02:00 committed by GitHub
parent 6bbd1f3718
commit 6a8c544914

View File

@ -108,6 +108,16 @@ end
local function tabulateCommon( bPaged, ... ) local function tabulateCommon( bPaged, ... )
local tAll = { ... } local tAll = { ... }
for i=1,#tAll,2 do
if type( tAll[i] ) ~= "number" then
error( "bad argument #"..i.." (expected number, got " .. type( tAll[i] ) .. ")", 3 )
end
end
for i=2,#tAll,2 do
if type( tAll[i] ) ~= "table" then
error( "bad argument #"..i.." (expected table, got " .. type( tAll[i] ) .. ")", 3 )
end
end
local w,h = term.getSize() local w,h = term.getSize()
local nMaxLen = w / 8 local nMaxLen = w / 8
@ -158,32 +168,10 @@ local function tabulateCommon( bPaged, ... )
end end
function tabulate( ... ) function tabulate( ... )
tArgs = { ... }
for i=1,#tArgs,2 do
if type( tArgs[i] ) ~= "number" then
error( "bad argument #"..i.." (expected number, got " .. type( tArgs[i] ) .. ")", 2 )
end
end
for i=2,#tArgs,2 do
if type( tArgs[i] ) ~= "table" then
error( "bad argument #"..i.." (expected table, got " .. type( tArgs[i] ) .. ")", 2 )
end
end
tabulateCommon( false, ... ) tabulateCommon( false, ... )
end end
function pagedTabulate( ... ) function pagedTabulate( ... )
tArgs = { ... }
for i=1,#tArgs,2 do
if type( tArgs[i] ) ~= "number" then
error( "bad argument #"..i.." (expected number, got " .. type( tArgs[i] ) .. ")", 2 )
end
end
for i=2,#tArgs,2 do
if type( tArgs[i] ) ~= "table" then
error( "bad argument #"..i.." (expected table, got " .. type( tArgs[i] ) .. ")", 2 )
end
end
tabulateCommon( true, ... ) tabulateCommon( true, ... )
end end