Module:AgeTemplate: Difference between revisions

From ProleWiki, the proletarian encyclopedia
(Created sketch of module to test it)
 
m (Making arguments read strings instead of numbers to see if it works)
Line 8: Line 8:
local arg3 = pframe.args[3]
local arg3 = pframe.args[3]
if arg1 == 1 or arg1 == 2 or arg1 == 3 then
if arg1 == "1" or arg1 == "2" or arg1 == "3" then
return "1, 2 or 3 in first argument"
return "1, 2 or 3 in first argument"
else
else

Revision as of 14:33, 3 September 2022

local p = {}

function p.age( frame )
	local pframe = frame:getParent()
	
	local arg1 = pframe.args[1]
	local arg2 = pframe.args[2]
	local arg3 = pframe.args[3]
	
	if arg1 == "1" or arg1 == "2" or arg1 == "3" then
		return "1, 2 or 3 in first argument"
		else
			return "Not 1, nor 2 or 3 in first argument"
	end
end
return p