Module:TableTools: Difference between revisions

Implementing talk page edit requested
m (1 revision imported)
$wgImportSources>Alex 21
(Implementing talk page edit requested)
Line 426:
-- 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 #.
-- 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)
local i = 01
untilwhile t[i] =~= nil do
repeat
i = i + 1
end
until t[i] == nil
return i - 1
end