Vorlage:boolandnot/Doku
Erscheinungsbild
Vorlage:Dokumentation/Seitenhinweis
[Vorlagenprogrammierung] Logische AND-NOT-Verknüpfung zweier Zeichenketten – erzeugt einen nichtleeren String (gibt also „wahr“ zurück), wenn der erste Parameter nicht leer und der zweite leer ist
<templatestyles src="TOC nonum/styles.css"></templatestyles>
⧼templatedata-doc-params⧽
| ⧼templatedata-doc-param-name⧽ | ⧼templatedata-doc-param-desc⧽ | ⧼templatedata-doc-param-type⧽ | ⧼templatedata-doc-param-status⧽ | |
|---|---|---|---|---|
| 1 | 1 | Erste Zeichenkette | ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-required⧽ |
| 2 | 2 | Zweite Zeichenkette | ⧼templatedata-doc-param-type-string⧽ | ⧼templatedata-doc-param-status-required⧽ |
Kopiervorlage
<syntaxhighlight lang="wikitext" copy>
</syntaxhighlight>
Hinweis
Beide Parameter müssen erst ausgewertet werden, bevor sie verknüpft werden können. Das ist ein Problem, wenn die Ermittlung des ersten aufwändig ist („teuer“ oder sonst performancekritisch). Besser ist dann: <syntaxhighlight lang="wikitext" copy>
</syntaxhighlight>
Wahrheitstabelle
| Eingabe | Ausgabe |
|---|---|
| {{boolandnot| | }} | |
| {{boolandnot| |1}} | |
| {{boolandnot|1| }} | 1 |
| {{boolandnot|1|1}} |
Beispiele
{{#if: {{boolandnot| | }}| Ja | Nein}} |
ergibt: | Nein |
{{#if: {{boolandnot|xxx| }}| Ja | Nein}} |
ergibt: | Ja |
{{#if: {{boolandnot| |non}}| Ja | Nein}} |
ergibt: | Nein |
{{#if: {{boolandnot| |xxx}}| Ja | Nein}} |
ergibt: | Nein |
{{#if: {{boolandnot|xxx|xxx}}| Ja | Nein}} |
ergibt: | Nein |
{{#if: {{boolandnot|000|000}}| Ja | Nein}} |
ergibt: | Nein |