Help:Array: Difference between revisions

Content deleted Content added
TRANSWIKI: Copied from Meta:Help:Array.
TRANSWIKI: Copied from Meta:Help:Array.
Line 57:
<code><nowiki>{{foreach|call=Short DOW|7}}</nowiki></code> gives "{{foreach|call=Short DOW|7}}"
 
<code><nowiki>{{foreach|call=Short DOW|sep=-|3|{{CURRENTDOW}}|7}}</nowiki></code> gives "{{foreach|call=Short DOW|separatorsep=-|3|{{CURRENTDOW}}|7}}"
 
==Other method==
Line 88:
A matching example data template is {{tim|Array1440 data demo}}. The first part contains 1440 pieces of code of the form "5=abc". The second part contains 1440 pieces of code of the form "{{{00:04|}}}=". This part can be reused for other data arrays with these index values.
 
{{tim|City array demo}}, containing:
{{timcnl|City array demo}} shows that the first part can contain less than 1440 data, while for the second part this is also the case, and this part may contain more than the first part, for convenient expanding of the array by just adding to the first part.
----
<pre>{{concat1440|2=Amsterdam|3=Rotterdam|4=The Hague|12=Amersfoort|17=01|{{{00:01}}}=|{{{00:02}}}=|{{{00:03}}}=|{{{00:04}}}=|{{{00:05}}}=|{{{00:06}}}=|{{{00:07}}}=|{{{00:08}}}=|{{{00:09}}}=
|{{{00:10}}}=|{{{00:11}}}=|{{{00:12}}}=|{{{00:13}}}=|{{{00:14}}}=|{{{00:15}}}=|{{{00:16}}}=|{{{00:17}}}=|{{{00:18}}}=|{{{00:19}}}=
|{{{00:20}}}=|{{{00:21}}}=|{{{00:22}}}=|{{{00:23}}}=|{{{00:24}}}=|{{{00:25}}}=}}</pre>
{{timcnl|City array demo}}---- shows that the first part can contain less than 1440 data, while for the second part this is also the case, and this part may contain more than the first part, for convenient expanding of the array by just adding to the first part.
 
Examples:
Line 127 ⟶ 132:
 
On the other hand, in the method on this page enlarging the array, when no preparation for that has been made in advance, requires updating three templates, while the other method requires updating one and creating one.
 
==See also==
*[[w:en:Wikipedia talk:Avoid using meta-templates#Logic templates|Logic templates]] (discussion)
 
{{h:f|enname=Array}}