"ഘടകം:Autotaxobox" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
experimental new function
Undid revision 850359898 by Peter coxhead (talk) whoops, meant to add to sandbox
വരി 299:
end
return res .. '|}\n'
end
 
function p.find(frame)
local currTaxon = frame.args[1] or ''
if currTaxon == '' then return 'ERROR: no taxon supplied' end
local rank = frame.args[2] or ''
if rank == '' then return 'ERROR: no rank supplied' end
local inHierarchy = true -- still in the taxonomic hierarchy or off the top?
local searching = true -- still searching
while inHierarchy and searching do
local ok, parent = p.getTaxonInfoItem(frame, currTaxon, 'parent')
if ok and parent ~= '' then
currTaxon = parent
if p.getTaxonInfoItem(frame, currTaxon, 'rank') == rank then
searching = false
end
else
inHierarchy = false
end
end
if inHierarchy and not searching then return currTaxon
else return ''
end
end
 
"https://ml.wikipedia.org/wiki/ഘടകം:Autotaxobox" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്