Ad placeholder

User:Toancaro/List of utilities spells/Variables: Difference between revisions

Jump to navigation Jump to search
m
Line 33: Line 33:


/><section end="variables" /></includeonly>
/><section end="variables" /></includeonly>
{{Back to top}}
==Join OR==
{{Template:TranscludeableLST|joinOR}}
<syntaxhighlight line="1">
{{#arraydefine: joinORItems | a,b,c,d,e}}
{{#vardefine: joinORPageSize | 1}}
{{#vardefine: test | {{#lst:User:Toancaro/List of utilities spells/Variables|joinOR}} }}
{{#var: test}}
</syntaxhighlight>
Result: <nowiki/>
{{#arraydefine: joinORItems | a,b,c,d,e}}<nowiki/>
{{#vardefine: joinORPageSize | 1}}<nowiki/>
{{#vardefine: test | {{#lst:User:Toancaro/List of utilities spells/Variables|joinOR}} }}<nowiki/>
{{#var: test}}
<includeonly><section begin="joinOR" /><nowiki
/>{{#arrayunion: joinORItems | {{#if: {{#arraysize:joinORItems}} | joinORItems | }} }}<nowiki
/>{{#vardefine: joinORPageSize | {{#varexists:joinORPageSize | {{#var:joinORPageSize}} | 25 }} }}<nowiki
/>{{#vardefine: joinORResult | }}<nowiki
/>{{#loop: i | 0 | {{#expr: ceil({{#arraysize:joinORItems}} / {{#var:joinORPageSize}})}} | <nowiki
  />{{#arrayslice: itemSliced | joinORItems | {{#expr: {{#var: i}} * {{#var:joinORPageSize}} }} | {{#var:joinORPageSize}}}}<nowiki
  />{{#vardefine: itemsOR | {{#arrayprint: itemSliced | OR | @ | name = "@" }}}}<nowiki
  />{{#vardefine: itemsORNormalized | {{#replace:{{#var: itemsOR}} | OR | <nowiki/> <nowiki/>OR<nowiki/> <nowiki/>}}}}<nowiki
  />{{#vardefine: joinORResult | {{#if: {{#var:joinORResult}} | {{#var:joinORResult}} OR {{#var:itemsORNormalized}} | {{#var:itemsORNormalized}} }} }}<nowiki
/>}}<nowiki
/>{{#var: joinORResult}}<nowiki
/><section end="joinOR" /></includeonly>
{{Back to top}}
{{Back to top}}
791
edits

Navigation menu