Difference between revisions of "Module:TableTools"

Jump to navigation Jump to search
158 bytes added ,  02:09, 1 March 2020
m
4 revisions imported from meta:Module:TableTools
>Pppery
>Minorax
m (4 revisions imported from meta:Module:TableTools)
 
(6 intermediate revisions by 6 users not shown)
Line 426: Line 426:
-- a different value when there are gaps in the array portion of the table.
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]
--]]
function p.length(t)
function p.length(t)
local i = 0
local i = 1
repeat
while t[i] ~= nil do
i = i + 1
i = i + 1
until t[i] == nil
end
return i - 1
return i - 1
end
end
Anonymous user

Navigation menu