Welcome to the DFO World Wiki. With many major updates since the release of DFO, many items are missing. Visit Item Database Project to learn more.
Please remember to click "show preview" before saving the page.
Thanks for the updated logo snafuPop!

Difference between revisions of "Template:Horizontal scale loop"

From DFO World Wiki
Jump to: navigation, search
(Created page with "{{<includeonly>safesubst:</includeonly>#invoke:For loop|main}}<noinclude> {{documentation}} <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noincl...")
 
m (Protected "Template:Horizontal scale loop": Don't change the algorithm ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{<includeonly>safesubst:</includeonly>#invoke:For loop|main}}<noinclude>
+
{{#arraydefine:arr|{{{times|1}}}}}<!--Create an array named "arr" and if times is not specified, use 1-->
{{documentation}}
+
{{#arrayprint:arr||@@@@|<!--Loop index is now @@@@-->
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
+
{{Horizontal scale
</noinclude>
+
|from={{{from}}}
 +
|to={{{to}}}
 +
|increment={{{increment}}}
 +
|loop=@@@@
 +
}}
 +
}}
 +
<noinclude>{{documentation}}

Latest revision as of 11:53, 15 August 2018


Please delete the line increment=. It's preventing the template from working.

Template Documentation view

Uses Extension:Arrays to perform the for loop.

Description

The template calls {{Horizontal scale}}

Usage

{{Horizontal scale loop
  |times=how many you want to loop to go using a comma separated list
  |from=starting number
  |to=ending number
  |increment=what the increment is.
}}

Examples

Code Result
{{Horizontal scale loop
|times=1
|from=1
|to=100
|increment=5
}}
|
6
{{Horizontal scale loop
|times=1,2,3,4,5
|from=1
|to=100
|increment=5
}}
|
6
|
11
|
16
|
21
|
26