Vorlage:Booland/Doku: Unterschied zwischen den Versionen

Aus RI Wiki
Zur Navigation springenZur Suche springen
w>Darkking3
K Wahrheitstabellen: einheitliche Größe
 
K 1 Version importiert
 
(kein Unterschied)

Aktuelle Version vom 28. August 2024, 14:01 Uhr

Logische Und-Verknüpfung von zwei oder mehr Werten (nur für Vorlagenprogrammierung)

⧼templatedata-doc-params⧽

1. Wert1
1. Wert zur Verknüpfung
2. Wert2
2. Wert zur Verknüpfung
weiterer Wert3
Weiterer Wert zur Verknüpfung
weitere Werte4
Beliebig viele weitere Werte zur Verknüpfung

Kopiervorlage

{{booland| | }}
{{booland| | | }}
{{booland| | | | }}
{{booland| | | | | }}
{{booland| | | | | | }}

Hinweise

Im Unterschied zur Wikisyntax werden nicht nur leere Strings als „false“ betrachtet, sondern auch solche, welche 0, - oder false enthalten.

Die Vorlage erzeugt einen nichtleeren String (1, also „wahr“), wenn alle Parameter nach vorstehender Regel „wahr“ sind, ansonsten einen leeren String.

Ein leerer Parameter, also auch etwa |}}, bewirkt stets ein logisches „falsch“.

Beispiele

  • {{#if: {{booland|| }} | Ja | Nein}} ergibt

Nein

  • {{#if: {{booland|xxx| }} | Ja | Nein}} ergibt

Nein

  • {{#if: {{booland| |yyy}} | Ja | Nein}} ergibt

Nein

  • {{#if: {{booland|xxx|yyy}} | Ja | Nein}} ergibt

Ja

  • {{#if: {{booland|xxx|yyy| }} | Ja | Nein}} ergibt

Nein

  • {{#if: {{booland|xxx|yyy|}} | Ja | Nein}} ergibt

Nein

Wahrheitstabellen

Zwei Parameter
Eingabe Ausgabe
{{booland| | }}
{{booland| |1}}
{{booland|1| }}
{{booland|1|1}} 1
Drei Parameter
Eingabe Ausgabe
{{booland| | | }}
{{booland| |1| }}
{{booland|1| | }}
{{booland|1|1| }}
{{booland| | |1}}
{{booland| |1|1}}
{{booland|1| |1}}
{{booland|1|1|1}} 1
Vier Parameter
Eingabe Ausgabe
{{booland| | | | }}
{{booland| |1| | }}
{{booland|1| | | }}
{{booland|1|1| | }}
{{booland| | |1| }}
{{booland| |1|1| }}
{{booland|1| |1| }}
{{booland|1|1|1| }}
{{booland| | | |1}}
{{booland| |1| |1}}
{{booland|1| | |1}}
{{booland|1|1| |1}}
{{booland| | |1|1}}
{{booland| |1|1|1}}
{{booland|1| |1|1}}
{{booland|1|1|1|1}} 1

Siehe auch