Vorlage:Booland/Doku

Aus FreeWiki
Wechseln zu: Navigation, Suche

Vorlage:Dokumentation/Dokuseite

Lua

Datei:Lua-logo-nolabel.svg Diese Vorlage wurde ganz oder teilweise mit Hilfe der Programmiersprache Lua erstellt.
Die Module sind mit #invoke eingebunden. In der Dokumentation der einzelnen Module finden sich auch weitere Hinweise zu Rückfragen.

Verwendetes Modul:

Diese Vorlage dient der logischen Verknüpfung von zwei oder mehr Zeichenketten (Strings).

Die Vorlage erzeugt einen nichtleeren String (gibt also „wahr“ zurück), wenn alle Parameter nicht leer (also „wahr“) sind, ansonsten einen leeren String.

Siehe dazu auch unter Hilfe:Vorlagenprogrammierung#Überprüfung von Zeichenketten

Kopiervorlage

{{Booland| | }}
{{Booland| | | }}
{{Booland| | | | }}
{{Booland| | | | | }}
{{Booland| | | | | | }}

Parameter

Zwei oder mehr Strings.

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

Ein leerer Parameter am Ende, also |}} bewirkt stets ein logisches "falsch", also einen leeren String.

Wahrheitstabelle

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