Template talk:Foreach

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

This template has stopped working due to some software change. Use Template:For instead.


Template:Foreach

containing

{{foreach/pass1
  |v@=
  |c={{{call}}}
  |pv={{{pv|1}}}
  |s={{{separator|}}}{{{sep|}}}
  |pc1={{{pc1|=}}}
  |pc2={{{pc2|=}}}
  |pc3={{{pc3|=}}}
  |pc4={{{pc4|=}}}|
{{{1|@}}}|{{{2|@}}}|{{{3|@}}}|{{{4|@}}}|...|{{{150|@}}}}}

using Template:Foreach/pass1

containing

<!--
-->{{{{{{{{v{{{1|}}}|c}}}|x0}}}|{{{pv}}}={{{1}}}|{{{pc1}}}|{{{pc2}}}|{{{pc3}}}|{{{pc4}}}}}{{{v{{{2|}}}|{{{s|}}}}}}<!--
-->{{{{{{{{v{{{2|}}}|c}}}|x0}}}|{{{pv}}}={{{2}}}|{{{pc1}}}|{{{pc2}}}|{{{pc3}}}|{{{pc4}}}}}{{{v{{{3|}}}|{{{s|}}}}}}<!--
-->{{{{{{{{v{{{3|}}}|c}}}|x0}}}|{{{pv}}}={{{3}}}|{{{pc1}}}|{{{pc2}}}|{{{pc3}}}|{{{pc4}}}}}{{{v{{{4|}}}|{{{s|}}}}}}<!--
...
-->{{{{{{{{v{{{150|}}}|c}}}|x0}}}|{{{pv}}}={{{150}}}|{{{pc1}}}|{{{pc2}}}|{{{pc3}}}|{{{pc4}}}}}

Contents

[edit] Documentation

[edit] Description

The template calls a specified template up to 150 times, where one parameter takes each of a list of values; in addition to the variable parameter, for up to 4 parameters a fixed value can be specified.

[edit] Usage

{{foreach
  |call=template to call
  |sep=what to separate the entries with
  |pc1=parameter name=constant value
  |pc2=parameter name=constant value
  |pc3=parameter name=constant value
  |pc4=parameter name=constant value
  |pv=name of variable parameter
  |list of up to 150 parameter values, with separator "|"
}}

[edit] Examples

Code Result
1{{foreach
|00|01|02|03|04|05|06|07|08|09
|10|11|12|13|14|15|16|17|18|19
|20|21|22|23|24|25|26|27|28|29
|30|31|32|33|34|35|36|37|38|39
|40|41|42|43|44|45|46|47|48|49
|50|51|52|53|54|55|56|57|58|59
|60|61|62|63|64|65|66|67|68|69
|70|71|72|73|74|75|76|77|78|79
|80|81|82|83|84|85|86|87|88|89
|90|91|92|93|94|95|96|97|98|99
  |call=x1
  |sep=, 1
}}
1=

00|=|=|=|=}}, 1{{x1|1=01|=|=|=|=}}, 1{{x1|1=02|=|=|=|=}}, 1{{x1|1=03|=|=|=|=}}, 1{{x1|1=04|=|=|=|=}}, 1{{x1|1=05|=|=|=|=}}, 1{{x1|1=06|=|=|=|=}}, 1{{x1|1=07|=|=|=|=}}, 1{{x1|1=08|=|=|=|=}}, 1{{x1|1=09

=|=|=}}, 1{{x1|1=10|=|=|=|=}}, 1{{x1|1=11|=|=|=|=}}, 1{{x1|1=12|=|=|=|=}}, 1{{x1|1=13|=|=|=|=}}, 1{{x1|1=14|=|=|=|=}}, 1{{x1|1=15|=|=|=|=}}, 1{{x1|1=16|=|=|=|=}}, 1{{x1|1=17|=|=|=|=}}, 1{{x1|1=18|=|=|=|=}}, 1{{x1|1=19 =|=|=}}, 1{{x1|1=20|=|=|=|=}}, 1{{x1|1=21|=|=|=|=}}, 1{{x1|1=22|=|=|=|=}}, 1{{x1|1=23|=|=|=|=}}, 1{{x1|1=24|=|=|=|=}}, 1{{x1|1=25|=|=|=|=}}, 1{{x1|1=26|=|=|=|=}}, 1{{x1|1=27|=|=|=|=}}, 1{{x1|1=28|=|=|=|=}}, 1{{x1|1=29 =|=|=}}, 1{{x1|1=30|=|=|=|=}}, 1{{x1|1=31|=|=|=|=}}, 1{{x1|1=32|=|=|=|=}}, 1{{x1|1=33|=|=|=|=}}, 1{{x1|1=34|=|=|=|=}}, 1{{x1|1=35|=|=|=|=}}, 1{{x1|1=36|=|=|=|=}}, 1{{x1|1=37|=|=|=|=}}, 1{{x1|1=38|=|=|=|=}}, 1{{x1|1=39 =|=|=}}, 1{{x1|1=40|=|=|=|=}}, 1{{x1|1=41|=|=|=|=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|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@ =|=|=}}

Note that the last part of the separator is used as a prefix; the first prefix needs to be put separately.

{{foreach|a|3||c|call=x3|sep=-}} using Template:X3 gives

{{x3|1=

a|=|=|=|=}}-{{x3|1=3|=|=|=|=}}-{{x3|1=|=|=|=|=}}-{{x3|1=c|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|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=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@ |=|=|=|=}}

{{foreach|call=t2|pc1=2=constant|abc|def|ghi}} using Template:T2 gives:

{{t2|1= abc|2=constant|=|=|=}}{{t2|1=def|2=constant|=|=|=}}{{t2|1=ghi|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@|2=constant|=|=|=}}{{x0|1=@ |2=constant|=|=|=}}

A constant parameter overrides the variable parameter if it has the same name as the implicitly or explicitly given name of the latter:

{{foreach|call=t2|pc1=1=7|pc2=2=5|abc|def|ghi|sep=,}} using Template:T2 gives:

{{t2|1= abc|1=7|2=5|=|=}},{{t2|1=def|1=7|2=5|=|=}},{{t2|1=ghi|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|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5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@|1=7|2=5|=|=}}{{x0|1=@ |1=7|2=5|=|=}}

This is a difference with Template:For.

Semi-recursive: see Template talk:Foreach/recursion

A reserved name that cannot be used as list item is "@"; it is ignored, but e.g. @1 is not:

{{foreach|a|@|@1|b|c|call=x3|sep=-}} gives

{{x3|1=

a|=|=|=|=}}{{x0|1=@|=|=|=|=}}-{{x3|1=@1|=|=|=|=}}-{{x3|1=b|=|=|=|=}}-{{x3|1=c|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|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@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@ |=|=|=|=}}

[edit] Related template

This template is based on w:en:Template:Foreach. A difference is:

  • The Meta version handles empty parameter values in the regular way, while the en version ignores them.

[edit] See also

[edit] Discussion

I don't know what you are trying to do, but the version I did, can handle "@" as a list item AzaToth 04:23, 4 December 2005 (UTC)

This version handles empty parameter values in the regular way, that may be useful in some applications. The @ was chosen as a symbol not needed as parameter value. Another special character or sequence could also be chosen.--Patrick 10:01, 4 December 2005 (UTC)

Why I didn't added named extra parameters to my version, is because you could easly type with extra call parameter 1=foo=bar, also, could you explain the first difference?

I also think my fist verion could hav problem if calling some templates, fixes as:

{{{{{c{{{c{{{v001|}}}|}}}|void}}}
  |{{{p0}}}={{{v001}}}
  |{{{p1}}}
  |{{{p2}}}
  |{{{p3}}}
  |{{{p4}}}
}}

instead of

{{{v001{{{v001|}}}|{{{{{c}}}
  |{{{p0}}}={{{v001}}}
  |{{{p1}}}
  |{{{p2}}}
  |{{{p3}}}
  |{{{p4}}}
}}}}}

(calling void instead of template if v001... is nada)

AzaToth 13:17, 4 December 2005 (UTC)

OK, I understand now what you mean by ignoring empty parameters, I was ignoring that case because I was didn't think anyone would apply empty parameters in the arguments AzaToth 13:45, 4 December 2005 (UTC)

[edit] Changed pass1

Changed like I did in the en version so the called template always is outside parameter AzaToth 17:57, 10 December 2005 (UTC)

What is the advantage? It seems a little more complicated.--Patrick 00:25, 11 December 2005 (UTC)
  • The older version can have problem if the called template returns a part of a template for example (a row) AzaToth 00:43, 11 December 2005 (UTC)
  • Can you give an example?--Patrick 10:05, 11 December 2005 (UTC)
  • Can try:

Template:t4 containing "|-

|Data

|{{{1}}}"

{{t4|1= A|=|=|=|=}}{{t4|1=B|=|=|=|=}}{{t4|1=C|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|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=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@|=|=|=|=}}{{x0|1=@

=|=|=}}
Data BA
Data C

Ok, now I'm confused, when I typed the above, the for didn't work, now it works :/ AzaToth 12:12, 11 December 2005 (UTC)

Personal tools
Namespaces

Variants
Actions
Navigation
Community
Beyond the Web
Toolbox