Module:Redirect hatnote: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
use a repeat ... until loop to avoid creating an unnecessary blank table
(Ok, I think this got it)
(use a repeat ... until loop to avoid creating an unnecessary blank table)
Line 14:
-- Get the args table and work out the maximum arg key.
 
--[[
local origArgs = frame:getParent().args
local args = {}
Line 25 ⟶ 24:
if v ~= '' then
args[k] = v
end
end
--]]
 
local args = require('Module:Arguments').getArgs(frame)
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then
maxArg = k
end
end
Line 51 ⟶ 41:
local iArg = 0
local iData = 1
repeat
while iArg < maxArg do
iArg = iArg + 2
local useTable = data[iData] or {}
Line 65 ⟶ 55:
iData = iData + 1
end
whileuntil iArg <>= maxArg do- 1
mw.logObject(useTable)
end
 
-- Create the options table.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu