A logical expression has the same format and operator precedence as a logical expression in C. It is built from logical operators and logical operands:
relation ::= "TRUE" | "FALSE" | real-expr rel-operator real-expr rel-operator ::= "==" | "!=" | "<" | ">" | ">=" | "<=" and-expr ::= relation | and-expr "&&" relation logical-expr ::= and-expr | logical-expr "||" and-expr
Operator | Meaning | result type | operand type |
X Y | true, if X is less than Y | logical | real,real |
X Y | true, if X is not greater than Y | logical | real,real |
X Y | true, if X is greater than Y | logical | real,real |
X Y | true, if X is not less than Y | logical | real,real |
X Y | true, if X is equal to Y | logical | real,real |
X Y | true, if X is not equal to Y | logical | real,real |
X && Y | true, if both X and Y are true | logical | logical,logical |
X || Y | true, if at least one of X and Y is true | logical | logical,logical |
Example:
OPTION,ECHO=TRUE; // output echo is desiredWhen a logical attribute is not entered, its default value is always false. When only its name is entered, the value is set to TRUE:
OPTION,ECHO; // same as aboveExample of a logical expression:
X>10 && Y<20 || Z==15