Modulo:Valido in corsivo/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
prova correzione valori caratteri (esadecimali -> decimali)
chiamato da modulo, restituisce true/false; chiamato da template, restituisce sì/no o nulla se il parametro non è compilato
Riga 1:
local i = {}
 
-- Funzione per l'utilizzo da altro modulo
i._IsLatin = function(args)
local txt = args[1];
if txt == '' then return false end
return '';
local len = mw.ustring.len(txt);
end
local pos = 1
while ( pos <= len ) do
local len = mw.ustring.len(txt);
charval = mw.ustring.codepoint(mw.ustring.sub(txt, pos))
local pos = 1;
if charval >= 880 and charval < 8192 then
while ( pos <= len ) do
return "sì";false
charval = mw.ustring.codepoint(mw.ustring.sub(txt, pos))
elseif charval >= 8448 then
if charval>=880 and charval<8192 then
return "no";false
end
elseif
pos = pos + 1;
charval>=8448 then
end
return "no";
return true
end
pos = pos + 1;
end
return "sì";
end
 
-- Funzione per il template IsLatin
i.IsLatin = function(frame)
returnif i._IsLatin(frame.args)[1] == '' then return end
return i._IsLatin(frame.args) and 'sì' or 'no'
end