Module:Sort: Difference between revisions

From Guild of Archivists
(try without "local" (does not seem to affect anything here))
 
m (1 revision imported)
 

Latest revision as of 07:26, 30 October 2015

Documentation for this module may be created at Module:Sort/doc

p={}
  
function p.f(frame)
    t={}
    delim = frame.args[1]
    for n,v in frame:argumentPairs() do table.insert (t,v) end
    t[1]=''
    table.sort (t)
    for i,v in ipairs(t) do 
        if i>2 then r=r..delim..v elseif i==2 then r=v end
    end
    return r
end
 
return p