Modul:TemplatePar: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
update
wp>PerfektesChaos (Setup) |
wp>PerfektesChaos (update) |
||
Zeile 1: | Zeile 1: | ||
--[=[ TemplatePar 2013-04- | --[=[ TemplatePar 2013-04-28 | ||
Template parameter utility | Template parameter utility | ||
* check | * check | ||
Zeile 122: | Zeile 122: | ||
return r | return r | ||
end -- fetch() | end -- fetch() | ||
local function figure() | |||
-- Return number of template parameters | |||
-- Postcondition: | |||
-- Return number, starting at 0 | |||
-- Uses: | |||
-- > invokeFrame | |||
-- frame:getParent() | |||
local k, v | |||
local r = 0 | |||
local t = invokeFrame:getParent() | |||
local o = t.args | |||
for k, v in pairs( o ) do | |||
r = r + 1 | |||
end -- for k, v | |||
return r | |||
end -- figure() | |||
Zeile 330: | Zeile 349: | ||
-- Return string with digits including "0" | -- Return string with digits including "0" | ||
-- Uses: | -- Uses: | ||
-- | -- figure() | ||
-- < invokeFrame | -- < invokeFrame | ||
invokeFrame = frame | invokeFrame = frame | ||
return tostring( figure() ) | |||
return tostring( | |||
end -- .count() | end -- .count() | ||
function p.valid( frame ) | |||
-- Check validity of one template parameter | |||
-- Precondition: | |||
-- frame -- object; #invoke environment | |||
-- Postcondition: | |||
-- Return string with error message or "" | |||
-- Uses: | |||
-- < invokeFrame | |||
invokeFrame = frame | |||
return "#invoke:TemplatePar|valid| Not yet available" | |||
end -- .valid() | |||
return p | return p |