Mòdul:Proves/Albertvillanovadelmoral/Test
Aparença
Podeu crear la pàgina d'ús per documentar aquest mòdul Lua. |
local p = {}
local mylist = {}
mylist['691'] = {'03', '07', '08', '10', '11', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '27', '28', '31', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '54', '55'}
local myn = 02
--myn = 22
local mys = 'caca'
--mys = 'caca'
function departament(str)
local dep = string.sub(str,1,2)--str[1]..str[2]
if dep == '97' or dep == '98' then
return string.sub(str,1,3)
else
return dep
end
end
function p.Departament(str)
local dep = str[1]..str[2]
if dep == ('97' or '98') then
return dep..str[3]
else
return dep
end
end
function p.hola()
return 'Hola mon!'
end
function p.test()
-- mylist[691][1]
return mylist['691'][1]
--return myn
--return mys
end
function p.test2()
--return '91'..mylist['691'][1]
--return '{{Padró INSEE/Departament|691}}'
--return departament('691')
return departament('691')..mylist['691'][1]
end
function p.test3()
local mytable = {}
for _,idist in ipairs(mylist['691']) do
table.insert( mytable, departament('691')..idist)
end
return table.concat(mytable, ' , ')
end
return p