From GamingWiki
Jump to: navigation, search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{#if:{{{array|}}}|<!--
 
{{#if:{{{array|}}}|<!--
-->{{#vardefine: | {{{countfrom|1}}} }}<!--
+
  -->{{#arraydefine: inarray | {{{array}}} | {{{separator|;;}}} }}<!--
-->{{#vardefine: sep | {{{separator|;;}}} }}<!--
+
   -->{{#vardefine: countfrom | {{{countfrom|1}}} }}<!--
   -->{{#while:
+
  -->{{#arrayslice: thearray | inarray | {{#var: countfrom}} }}<!--
    | {{#vardefineecho: theitem
+
 
      | {{#explode: {{{array}}} | {{#var: sep}} | {{#var: i}} }}
+
TODO: get token and pattern args working
      }}{{#vardefine: previtem
+
  -->{{#vardefine: token | {{{token|@@@@@}}} }}<!--
      | {{#explode:{{{array}}}|{{#var: sep}}| {{#expr: {{#var: i}} - 1 }} }}
+
  -->{{#vardefine: pattern | {{{pattern|{{#var:token}}}}} }}<!--
      }}{{#vardefine: nextitem
+
  --><!-- token: ({{#var:token}}) pattern: ({{#var:pattern}}) --><!--
      | {{#explode:{{{array}}}|{{#var: sep}}| {{#expr: {{#var: i}} + 1 }} }}
+
 
      }}
+
  -->{{{beforefirst|{{{before|}}}}}}<!--
    |<!--
+
  -->{{#arrayprint: inarray |{{{after|}}}{{{between|}}}{{{before|}}}|@@@@@|@@@@@}}<!--
    -->{{#switch: <!--
+
  -->{{{afterlast|{{{after|}}}}}}<!--
    -->| {{#var: previtem}} = {{{beforefirst|{{{before|}}} }}}<!--
 
    -->| {{#var: nextitem}} = {{{beforelast|{{{before|}}} }}}<!--
 
    -->| #default = {{{before|}}}<!--
 
    -->}}<!--
 
    -->{{#var: theitem}}<!--
 
    -->{{#switch: <!--
 
    -->| {{#var: previtem}} = {{{afterfirst|{{{after|}}} }}}<!--
 
    -->| {{#var: nextitem}} = {{{afterlast|{{{after|}}} }}}<!--
 
    -->| #default = {{{after|}}}<!--
 
    -->}}<!--
 
    -->{{#vardefine: i | {{#expr: {{#var: i}} + 1}} }}<!--
 
  -->}}<!--
 
 
-->}}
 
-->}}

Latest revision as of 20:55, 17 February 2011