Content deleted Content added
Creating Module:Pn |
MusikBot II (talk | contribs) m Protected "Module:Pn": High-risk template or module: 259 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite)) |
||
(9 intermediate revisions by one other user not shown) | |||
Line 2:
Module that returns one value from a list of unnamed parameters
Named parameter idx is the index of the parameter that is to be returned
==]]
local p = {}
p.getVal = function(frame)
local args =
-- copy arguments from frame object and its parent
for k, v in pairs(frame.args) do
args[k] = v
end
args[k] = v
end
if not args[1] then
return nil
▲ args = frame:getParent().args
end
local idx = tonumber(args.idx) or 1
if idx <
return args[idx]
end
|