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

Latest revision as of 20:55, 17 February 2011