commit: conditionals docs

pull/17/head
Alec Muffett 2017-04-03 11:47:56 +01:00
rodzic b7aac63c9a
commit 42b3caaba9
1 zmienionych plików z 21 dodań i 1 usunięć

Wyświetl plik

@ -238,7 +238,7 @@ eg: `%%IF %ONION% eq facebookcorewwwi`
* `contains`
* `!contains`
Logic Operators
### Logic Operators
eg: `%%IF %BOOL1% and %BOOL2%` - no subexpressions, sorry
@ -246,6 +246,26 @@ eg: `%%IF %BOOL1% and %BOOL2%` - no subexpressions, sorry
* `or`
* `xor`
Also, simple conditionals (*not* expressions) may use `!` or `not` to
invert the sense of an if-statement, so this is valid
```
%%IF not %VALID%
Where VALID is boolean-evaluatable like 0 or 1
...
%%ENDIF
```
...but this is *not valid*
```
%%IF ! %FOO% eq BAR
*THIS WILL NOT WORK AS INTENDED*
*YOU WANT: %FOO% ne BAR*
...
%%ENDIF
```
### Operator Notes
If you are at risk of empty strings for string comparisons,