Editing Module:TableTools
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
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 #. | ||
--]] | --]] | ||
function p.length(t) | function p.length(t) | ||
local i = | local i = 0 | ||
repeat | |||
i = i + 1 | i = i + 1 | ||
until t[i] == nil | |||
return i - 1 | return i - 1 | ||
end | end |