Module:Sandbox/PHansen/Fteam explained

local p =

--

function p.main (frame) --

local country = frame.args[1] -- parameter from the template : countrylocal sex = frame.args[2] -- parameter from the template : male or female : m or klocal age = frame.args[3] -- parameter from the template : 21, 19, 17, or ? - national team, youth

local return_result = ""local dummy = "dummy"local error_msg = '

The format is {}'

--Errorif country

nil or country

"" or country

"m" or country

"k" or country

"[0-9]" then return (error_msg .. ' - `country` must be first parameter')end -- error if no country

-- if 'country' seemed OK then continue:-- men AND adults (no age given)if sex

"m" and age

"" then -- was: return_result = "" .. country .. "" return return_resultend -- adult, men

-- women AND adults (no age given)if sex

"k" and age

"" then --was: return_result = "" .. country .. "" return return_resultend -- adult, women

-- men AND youth (age given 17, 19, 21, or ?)if age ~= "" and sex

"m" then -- was: U/ return_result = "" .. country .. " U/" .. age .. "" return return_resultend -- men AND youth (age given 17, 19, 21, or ?)

-- women AND youth (age given 17, 19, 21, or ?)if age ~= "" and sex

"k" then -- was: U/ return_result = "" .. country .. " U/" .. age .. "" return return_resultend -- women AND youth (age given 17, 19, 21, or ?)

end -- function p.main (frame)

return p -- export table