Difference between revisions of "Template:Ifeqany"

From blackwiki
Jump to navigation Jump to search
imported>Jimp
imported>Jimp
(moving doc to /doc)
Line 1: Line 1:
<includeonly>{{ifeqany/yn|{{#expr:not({{#ifeq:{{{1}}}|{{{2}}}|0|1}}{{#if:{{{3|}}}|*{{#switch:{{{3}}}|{{{1}}}|{{{2}}}=0|1}}}}{{#if:{{{4|}}}|*{{#switch:{{{4}}}|{{{1}}}|{{{2}}}|{{{3}}}=0|1}}}}{{#if:{{{5|}}}|*{{#switch:{{{5}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}=0|1}}}}{{#if:{{{6|}}}|*{{#switch:{{{6}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}=0|1}}}}{{#if:{{{7|}}}|*{{#switch:{{{7}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}=0|1}}}}{{#if:{{{8|}}}|*{{#switch:{{{8}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}=0|1}}}}{{#if:{{{9|}}}|*{{#switch:{{{9}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}=0|1}}}}{{#if:{{{10|}}}|*{{#switch:{{{10}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}|{{{9}}}=0|1}}}}{{#if:{{{11|}}}|*{{#switch:{{{11}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}|{{{9}}}|{{{10}}}=0|1}}}}{{#if:{{{12|}}}|*{{#switch:{{{12}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}|{{{9}}}|{{{10}}}|{{{11}}}=0|1}}}}{{#if:{{{13|}}}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}}}|{{{19}}}|{{{20}}}|{{{21}}}|{{{22}}}|{{{23}}}=0|1}}}})}}|y={{{y|}}}|n={{{n|}}}}}</includeonly><noinclude>This template compares (unnamed) parameters (up to two dozen).  The output of the template is specified by optional parameters {{{y}}} and {{{n}}}.
+
<includeonly>{{ifeqany/yn|{{#expr:not({{#ifeq:{{{1}}}|{{{2}}}|0|1}}{{#if:{{{3|}}}|*{{#switch:{{{3}}}|{{{1}}}|{{{2}}}=0|1}}}}{{#if:{{{4|}}}|*{{#switch:{{{4}}}|{{{1}}}|{{{2}}}|{{{3}}}=0|1}}}}{{#if:{{{5|}}}|*{{#switch:{{{5}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}=0|1}}}}{{#if:{{{6|}}}|*{{#switch:{{{6}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}=0|1}}}}{{#if:{{{7|}}}|*{{#switch:{{{7}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}=0|1}}}}{{#if:{{{8|}}}|*{{#switch:{{{8}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}=0|1}}}}{{#if:{{{9|}}}|*{{#switch:{{{9}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}=0|1}}}}{{#if:{{{10|}}}|*{{#switch:{{{10}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}|{{{9}}}=0|1}}}}{{#if:{{{11|}}}|*{{#switch:{{{11}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}}}|{{{7}}}|{{{8}}}|{{{9}}}|{{{10}}}=0|1}}}}{{#if:{{{12|}}}|*{{#switch:{{{12}}}|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}|{{{5}}}|{{{6}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}}|{{{11}}}|{{{12}}}|{{{13}}}|{{{14}}}|{{{15}}}|{{{16}}}|{{{17}}}|{{{18}}}|{{{19}}}|{{{20}}}|{{{21}}}|{{{22}}}|{{{23}}}=0|1}}}})}}|y={{{y|}}}|n={{{n|}}}}}</includeonly><noinclude>{{/doc}}</noinclude>
*If both {{{y}}} and {{{n}}} are specified, the template returns {{{y}}} if there is a match or {{{n}}} otherwise.
 
*If only one of {{{y}}} or {{{n}}} is specified, the template returns nothing in place of the unspecified one.
 
*If neither {{{y}}} nor {{{n}}} are specified, the template returns ''1'' if there is a match or ''0'' otherwise.</noinclude>
 

Revision as of 02:37, 20 July 2007

This template compares the first unnamed parameter to each of the subsequent (unnamed) parameters (up to two dozen). The output of the template is specified by optional parameters {{{y}}} and {{{n}}}.

Example

Code

# {{ifeqany|ɪ|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ}}
# {{ifeqany|%|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ}}
# {{ifeqany|ɪ|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ|y=found a match|n=didn't find a match}}
# {{ifeqany|%|ɪ|ɛ|æ|ɒ|ʌ|ʊ|i|e|ɑ|ɔ|o|u|a|ɜ|ə|ɨ|y=found a match|n=didn't find a match}}

Result

  1. 1
  2. 0
  3. found a match
  4. didn't find a match

Details

  • If both {{{y}}} and {{{n}}} are specified, the template returns {{{y}}} if there is a match or {{{n}}} otherwise.
  • If only one of {{{y}}} or {{{n}}} is specified, the template returns nothing in place of the unspecified one.
  • If neither {{{y}}} nor {{{n}}} are specified, the template returns 1 if there is a match or 0 otherwise.

See also

{{ifeqall}}
Compares one comparison string against up to 10 case strings with optional result string and default result string outputs.
{{ifequal}}
Compares up to 16 comparison strings against an equal number of case strings.
{{ifor}}
Compares up to 30 comparison strings against an equal number of case strings with optional result string and default result string outputs.