Difference between revisions of "Sequence"

From Sega Retro

(no, that's not it)
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly>{{#vardefine:i|0}}{{#while:
 
<includeonly>{{#vardefine:i|0}}{{#while:
 
| {{#ifexpr: {{#len:{{#explode:{{{3}}}|{{{2}}}|{{#var:i}}}}}} > 0 | true }}
 
| {{#ifexpr: {{#len:{{#explode:{{{3}}}|{{{2}}}|{{#var:i}}}}}} > 0 | true }}
| {{#vardefine:{{{1|}}}|{{#explode:{{{3}}}|{{{2}}}|{{#var:i}}}}}}{{{4}}}{{#var:{{{1|}}}}}{{incvar|i}}
+
| {{#vardefine:{{{1|}}}|{{#explode:{{{3}}}|{{{2}}}|{{#var:i}}}}}}{{#replace:{{{4}}}|[{{{1}}}]|{{#var:{{{1|}}}}}}}{{incvar|i}}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
==Usage==
 
==Usage==
Line 10: Line 10:
 
===Example===
 
===Example===
 
<pre>{{sequence|region|,|jp,us,eu|&#32;
 
<pre>{{sequence|region|,|jp,us,eu|&#32;
* md_date_{{#var:region}}
+
* md_date_[region]
 
}}</pre>
 
}}</pre>
  
Line 16: Line 16:
  
 
{{sequence|region|,|jp,us,eu|&#32;
 
{{sequence|region|,|jp,us,eu|&#32;
* md_date_{{#var:region}}
+
* md_date_[region]
 
}}
 
}}
 +
 +
[[Category:Experimental templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:45, 19 July 2018

Usage

{{sequence|variablename|delimiter|array|
block statement
}}

Example

{{sequence|region|,|jp,us,eu| 
* md_date_[region]
}}

returns

  • md_date_jp
  • md_date_us
  • md_date_eu