Module:For loop/sandbox: Difference between revisions

Content deleted Content added
current main module with new 'for' function
hmm, {!} is not expaned in #invoke
Line 86:
p['for'] = function (frame)
-- Example: return 9 lines, first is "* [[Any text 1|1]]" with newline at end.
-- {{#invoke|for loop:ForLoop|for|1|9|* [[Any text {i}{!}{i}]]\n}}
local args = getArgs(frame)
local first = tonumber(args[1])
Line 97:
end
end
return (table.concat(result):gsub('{!}', '|'):gsub('\\n', '\n'))
end