Difference between revisions of "Template:Loop"
Jump to navigation
Jump to search
imported>Patrick m ({{documentation}}) |
imported>RockMFR (simplify per talk discussion) |
||
| Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>000|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>001|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>002|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>003|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>004|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>005|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>006|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>007|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>008|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>009|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>010|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>011|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>012|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>013|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>014|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>015|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>016|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>017|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>018|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>019|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>020|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>021|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>022|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>023|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>024|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>025|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>026|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>027|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>028|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>029|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>030|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>031|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>032|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>033|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>034|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>035|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>036|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>037|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>038|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>039|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>040|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>041|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>042|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>043|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>044|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>045|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>046|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>047|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>048|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>049|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>050|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>051|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>052|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>053|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>054|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>055|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>056|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>057|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>058|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>059|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>060|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>061|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>062|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>063|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>064|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>065|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>066|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>067|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>068|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>069|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>070|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>071|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>072|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>073|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>074|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>075|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>076|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>077|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>078|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>079|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>080|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>081|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>082|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>083|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>084|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>085|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>086|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>087|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>088|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>089|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>090|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>091|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>092|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>093|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>094|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>095|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>096|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>097|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>098|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>099|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>100|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>101|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>102|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>103|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>104|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>105|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>106|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>107|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>108|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>109|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>110|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>111|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>112|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>113|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>114|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>115|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>116|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>117|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>118|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>119|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>120|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>121|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>122|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>123|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>124|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>125|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>126|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>127|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>128|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>129|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>130|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>131|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>132|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>133|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>134|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>135|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>136|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>137|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>138|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>139|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>140|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>141|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>142|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>143|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>144|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>145|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>146|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>147|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>148|{{{2}}}}}<!-- |
| − | -->{{#ifexpr: | + | -->{{#ifexpr:{{{1}}}>149|{{{2}}}}}<!-- |
| − | --></includeonly><noinclude>{{pp-template | + | --></includeonly><noinclude> |
| + | {{pp-template}} | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Revision as of 01:03, 1 August 2009
| This template is used on approximately 94,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Transclusion count updated automatically (see documentation). |
| This template uses Lua: |
This template is used to produce a simple loop. It is based on Module:String, and there is no limit to the number of iterations it can perform.
Contents
Usage
{{loop|times to repeat|string}}
If string contains an equals sign, you must put "|2=string" instead of "|string".
Examples
{{loop|4|n}}
- nnnn
{{loop|25|test}}
- testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest
{{#expr:2{{loop|50|*2}}}}
- 2.2517998136852E+15
When the string being replicated includes "=", we have to precede the second parameter with "2=", or use {{=}}.
{{loop|9|2==}}
- =========
or:
{{loop|9|{{=}}}}
- =========
{{loop|3|{{CURRENTYEAR}}}}
- 202520252025
* If string contains an equals sign, you must put '|2=string' instead of '|string'.
Template data
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
TemplateData for Loop
The template is used to produce a simple loop of repeated strings.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Number | 1 | Number of times to repeat | Number | required |
| String | 2 | The string to be repeated. Use {{=}} if the string contains an equals sign. | String | required |
See also
- Template:For loop (edit | talk | history | links | watch | logs)
- Template:Simple recursion (edit | talk | history | links | watch | logs)
| The above documentation is transcluded from Template:Loop/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |