模块:ArgumentsInfo
1.38>牛腩面2022年7月4日 (一) 18:34的版本 (创建页面,内容为“local getArgs = require("Module:Arguments").getArgs return { getArgumentCount = function(frame) local args = getArgs(frame) local count = 0 for k, v in pairs(args) do count = count + 1 end return count end, getNum…)
此模块的文档可以在模块:ArgumentsInfo/doc创建
local getArgs = require("Module:Arguments").getArgs
return {
getArgumentCount = function(frame)
local args = getArgs(frame)
local count = 0
for k, v in pairs(args) do count = count + 1 end
return count
end,
getNumArgumentCount = function(frame)
local args = getArgs(frame)
local count = 0
for k, v in pairs(args) do
if type(k) == "number" then count = count + 1 end
end
return count
end
}