Khác biệt giữa bản sửa đổi của “Mô đun:For loop”

Nội dung được xóa Nội dung được thêm vào
n Mxn đã đổi Mô đun:ForLoop thành Mô đun:For loop (đã tắt đổi hướng): Cập nhật theo en:Module:For loop
Cập nhật theo en:Module:For loop (884521583)
Dòng 37:
targs[variableParam] = variableValPrefix .. v .. variableValPostfix
if calltemplates then
resultlocal output = result .. p.callTemplate(template, targs)
if #mw.text.trim(output) == 0 then
addSeparator = false
end
result = result .. output
else
result = result .. makeTemplate(template, targs)
Hàng 62 ⟶ 66:
function p.getVariableVals(args)
local variableVals = {}
if args.start or args.stop or args.by then
for i, v in ipairs(args) do
if i ~= 1args[2] then
error("Both start/stop/by and numbered parameters specified")
variableVals[i - 1] = v
end
start = tonumber(args.start or 1)
stop = tonumber(args.stop or 1)
by = tonumber(args.by or 1)
for i = start, stop, by do
variableVals [#variableVals + 1] = i
end
else
for i, v in ipairs(args) do
if i ~= 1 then
variableVals[i - 1] = v
end
end
end