Difference between revisions of "Template:Ifor"
imported>Hornoir |
imported>Hornoir |
||
| Line 1: | Line 1: | ||
{{#ifeq:{{lc:{{{test|n}}}}}|{{lc:{{{var|y}}}}}|{{{then|}}}| | {{#ifeq:{{lc:{{{test|n}}}}}|{{lc:{{{var|y}}}}}|{{{then|}}}| | ||
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test0|n}}}}}|{{lc:{{{var0|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test1|n}}}}}|{{lc:{{{var1|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test2|n}}}}}|{{lc:{{{var2|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test3|n}}}}}|{{lc:{{{var3|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test4|n}}}}}|{{lc:{{{var4|y}}}}}|{{{then|}}}| |
| − | {{#ifeq:{{ | + | {{#ifeq:{{lc:{{{test5|n}}}}}|{{lc:{{{var5|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test6|n}}}}}|{{lc:{{{var6|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test7|n}}}}}|{{lc:{{{var7|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test8|n}}}}}|{{lc:{{{var8|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test9|n}}}}}|{{lc:{{{var9|y}}}}}|{{{then|}}}| |
| − | {{#ifeq:{{ | + | {{#ifeq:{{lc:{{{test10|n}}}}}|{{lc:{{{var10|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test11|n}}}}}|{{lc:{{{var11|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test12|n}}}}}|{{lc:{{{var12|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test13|n}}}}}|{{lc:{{{var13|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test14|n}}}}}|{{lc:{{{var14|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test15|n}}}}}|{{lc:{{{var15|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test16|n}}}}}|{{lc:{{{var16|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test17|n}}}}}|{{lc:{{{var17|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test18|n}}}}}|{{lc:{{{var18|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test19|n}}}}}|{{lc:{{{var19|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test20|n}}}}}|{{lc:{{{var20|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test21|n}}}}}|{{lc:{{{var21|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test22|n}}}}}|{{lc:{{{var22|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test23|n}}}}}|{{lc:{{{var23|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test24|n}}}}}|{{lc:{{{var24|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test25|n}}}}}|{{lc:{{{var25|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test26|n}}}}}|{{lc:{{{var26|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test27|n}}}}}|{{lc:{{{var27|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test28|n}}}}}|{{lc:{{{var28|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test29|n}}}}}|{{lc:{{{var29|y}}}}}|{{{then|}}}| |
| − | {{#ifeq: | + | {{#ifeq:{{lc:{{{test30|n}}}}}|{{lc:{{{var30|y}}}}}|{{{then|}}}|{{{else|}}} |
}} | }} | ||
}} | }} | ||
Revision as of 12:47, 21 February 2009
The Template:Tf template extends the #ifeq: parser function, allowing it to pass multiple case strings against the same number of comparison strings. It returns a true result if any single case string is equal to any single comparison string, returning a false result otherwise.
Usage
This template compares if any comparison string (up to 30 unnamed numeric parameters; test1, test2, test3, etc.) equals its matching case string (up to 30 unnamed numeric parameters; val1, val2, val3, etc.) then returns a single result string (parameter then) if any are equal or returns a single optional default result string (parameter else) if none are equal.
The test and val parameters ignore case sensitivity (treat lower- and upper-case as equal inputs) and also ignore pre-integer zeros (e.g., 02 is equal to 2, 002 is equal to 2).
Full blank syntax
{{ifor
| test1 =
| val1 =
| test2 =
| val2 =
| test3 =
| val3 =
<!-- up to 30 test and var parameters can be inputted, using the same method as shown above -->
| then =
| else =
}}
See also
- {{ifeqall}}
- Compares one comparison string against up to 10 case strings with optional result string and default result string outputs.
- {{ifeqany}}
- Compares up to 24 case strings against each other with result string and default result string outputs.
- {{ifequal}}
- Compares up to 16 comparison strings against an equal number of case strings.
| The above documentation is transcluded from Template:Ifor/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |