Template:Booland: Difference between revisions

From Yogstation-13
Jump to navigation Jump to search
No edit summary
m (Removed leftover text)
 
Line 1: Line 1:
<includeonly>{{#if: {{{1|}}} | {{#if: {{{2|}}} | {{{3|1}}} | {{{4|}}} }} | {{{4|}}} }}</includeonly><noinclude>Logical and:
<includeonly>{{#if: {{{1|}}} | {{#if: {{{2|}}} | {{{3|1}}} | {{{4|}}} }} | {{{4|}}} }}</includeonly><noinclude>== About ==
== About ==
Compact version of a boolean '''AND'''-operator:
Compact version of a boolean '''AND'''-operator:
<pre>if {{{1|}}} and {{{2|}}} then
<pre>if {{{1|}}} and {{{2|}}} then

Latest revision as of 09:30, 24 April 2020

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