Template:Booland
Revision as of 09:29, 24 April 2020 by Helpful Herbert (talk | contribs)
Logical and:
About
Compact version of a boolean AND-operator:
if {{{1|}}} and {{{2|}}} then {{{3|1}}} else {{{4|}}}
Parameter-Usage
Parameter | Description |
---|---|
1, 2 | Conditions, evaluate true if neither missing and empty. A condition evaluates true for any non-empty text. |
3 | Result if both conditions are true |
4 | Result if at least one of the conditions is false |
Examples
Code | Result | Comment |
---|---|---|
{{Booland|A||Yup|Nope}}
|
Yup | |
{{Booland|A||Yup|Nope}}
|
Nope | |
{{Booland||B|Yup|Nope}}
|
Nope | |
{{Booland|||Yup|Nope}}
|
Nope | |
{{Booland|true|false|Yup|Nope}}
|
Yup | Conditions are checked as texts not as boolean values |
{{Booland|1|0|Yup|Nope}}
|
Yup | Conditions are checked as texts not as (boolean) numbers |
{{Booland| | |Yup|Nope}}
|
Nope | Spaces alone don't count as values |