Module:Loop: Difference between revisions

Teeth (talk | contribs)
add repi function for creating repeating css and stuff
 
Teeth (talk | contribs)
forgot to grab 3rd arg in repi
Line 14: Line 14:
local index_var = frame.args[1]
local index_var = frame.args[1]
local repetitions = tonumber( frame.args[2] )
local repetitions = tonumber( frame.args[2] )
local text = frame.args[3];
if not index_var then
if not index_var then
return str._error( 'function repi expects a string as first parameter, received "' .. ( frame.args[1] or '' ) .. '"' )
return str._error( 'function repi expects a string as first parameter, received "' .. ( frame.args[1] or '' ) .. '"' )
Line 19: Line 20:
if not repetitions then
if not repetitions then
return str._error( 'function repi expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
return str._error( 'function repi expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
if not text then
return str._error( 'function repi expects a string to repeat as third parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
end
str = ''
str = ''