Template:IfAND: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
==Use==
==Use==
This template will accept 2 variable names and return 1 if they are both true and nothing if any one of them is nonexistant.
This template will accept 10 variable names and return 1 if they all exist and nothing if any one of them is nonexistant or whitespace.
[[Category:Templates]]
[[Category:Templates]]
<pre>
<pre>
{{IfAND|variable1|variable2}}
{{IfAND|variable1|...|variable10}}
</pre>
</pre>
</noinclude>
</noinclude>
<includeonly>
<includeonly>
{{#switch: {{#if:{{{1}}}|{{{1|2}}}|1}}
{{#if:
| 1 =
{{#if:{{{1|}}}|
{{#if:{{{2|}}}|1
| 2 = 1
| {{#switch: {{#if:{{{2}}}|{{{2|2}}}|1}}
}}
| 1 =
}}
| 2 = 1
|1|}}
| {{#switch: {{#if:{{{3}}}|{{{3|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{4}}}|{{{4|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{5}}}|{{{5|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{6}}}|{{{6|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{7}}}|{{{7|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{8}}}|{{{8|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{9}}}|{{{9|2}}}|1}}
| 1 =
| 2 = 1
| {{#switch: {{#if:{{{10}}}|{{{10|2}}}|1}}
| 1 =
| 2 = 1
| 1
}}
}}
}}
}}
}}
}}
}}
}}
}}
}}
</includeonly>
</includeonly>

Revision as of 21:48, 17 April 2008

Use

This template will accept 10 variable names and return 1 if they all exist and nothing if any one of them is nonexistant or whitespace.

{{IfAND|variable1|...|variable10}}