Documentation for this module may be created at Module:IATA and ICAO code/sandbox1/doc
-- Some example functions for IATA and ICAO
local p = {}
local master = mw.loadData("Module:IATA and ICAO code/data/sandbox1")
function p.airportName(frame)
local icode = mw.text.trim(frame.args[1] or "")
if icode == "" then return "No parameter supplied" end
local aname = master.IATA[icode]
if not aname then aname = master.ICAO[icode] end
if not aname then return "No airport name for code " .. icode end
return aname
end
function p.wikiName(frame)
local icode = mw.text.trim(frame.args[1] or "")
if icode == "" then return "No parameter supplied" end
local wname = master.WikiName[icode]
if wname then return wname end
return "No Wiki name for code " .. icode
end
function p.IATAname(frame)
local icode = mw.text.trim(frame.args[1] or "")
if icode == "" then return "No parameter supplied" end
return master.IATA[icode] or "No IATA name for code " .. icode
end
function p.ICAOname(frame)
local icode = mw.text.trim(frame.args[1] or "")
if icode == "" then return "No parameter supplied" end
return master.ICAO[icode] or "No ICAO name for code ".. icode
end
return p