Modulo:Tracce/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
correggo formula
fix
Riga 132:
local nums = {}
for k, v in pairs(args) do
local numero_titolonum = k:match('%D(%d[0-9]+)$')
num = (num == '0' or num:sub(1,1) ~= '0') and num
if tonumber(numero_titolo) then
if num then
local titolo = args['Titolo' .. numero_titolonum]
if not titolo then
categories[#categories+1] = missing_title
elseif k == 'Titolo' .. numero_titolonum then
table.insert(nums, tonumber(numero_titolo)num)
end
end
Line 144 ⟶ 145:
table.sort(nums)
-- categoria di tracciamento se la numerazione delle tracce è discontinua
if nums[1] + #nums - 1 ~= tonumber(nums[#nums]) then
categories[#categories+1] = discontinuous_num
end
Line 172 ⟶ 173:
-- estrae tutti i parametri e li memorizza in una tabella
local args = {}
local titlestracce = false
for k, v in pairs(pframe.args) do
if v ~= nil and v ~= '' then
args[k] = v
iflocal notnum titles and= k:match("^Titolo(%d[0-9]+)$") then
num = num == '0' or num:sub(1,1) ~= '0'
titles = true
if not tracce and num then
titlestracce = true
end
end
end
-- procede solo se c'è almeno un campo titolo
return titlestracce and componi_tracce(args) or ''
end