UPDATE:
Upon further testing and asking around, it looks like my initial reading of the AND_NOT
logical connector was based on an older version of the documentation. It turns out that the AND_NOT
logical connector is broken and is not recognized by the VGR parser. It seems that the OR_NOT
operator works, but I still need to do some testing to confirm it. I've made some notations to this article where needed.
Original Post
When reading the VGR documentation and putting together my VGR Cheat Sheet, I found that, in addition to the familiar logical connectors {AND, OR, THEN}
, there are also the AND_NOT
and OR_NOT
connectors. If you're not sure what I'm talking about when I say logical connectors, this is how the VGR Handbook defines them:
Connector: A logical connector for linking multiline VGR rules. This only applies to IF statements with multiple conditions, and IF statements where there are multiple commands in the THEN clause.
That's to say, that seventh piece of your VGR code that:
- Connects multiple
IF
statements:IF ... AND ... AND ... THEN
- Connects multiple lines after the
IF
:IF ... THEN ... AND ...
If you look at the Logical Connectors section of my VGR Cheat Sheet, you'll see four entries: AND
, AND_NOT
, OR
, and OR_NOT
. Just as you might expect, the AND
returns true
if both IF
statements evaluate to true
and the OR
returns true
if either IF
statements evaluate to true
.
So what about the AND_NOT
andOR_NOT
logical connectors? They are a little more specific. The Similarly, the AND_NOT
returns true
if the first IF
evaluates to true
and the second IF
evaluates to false
.OR_NOT
evaluates to true
if the first IF
evaluates to true
or the second IF
evaluates to false