VBScript has a complete set of operators, including Arithmetic Operators, comparison operators, join operators, and logical operators.
Operator priority
When an expression contains multiple operators, each part is calculated in a predetermined order, which is called the operator priority. You can use parentheses to overwrite the priority order and force some parts of the expression to be calculated first. During operation, operators in parentheses are always executed first, and then operators outside parentheses are executed. However, the standard operator priority is still observed in parentheses.
When an expression contains multiple operators, the arithmetic operators are calculated first, then the comparison operators are calculated, and finally the logical operators are calculated. All comparison operators have the same priority, that is, the comparison operators are calculated from left to right. The priority of Arithmetic Operators and logical operators is as follows:
Arithmetic Operators comparison operators logical operators
Description symbol
Power ^ equals = logical not
Minus sign-not equal to <> logic and
Multiplication * is less than <logical or
Division/greater than> logical difference or XOR
Integer Division \ less than or equal to <= logical equivalent eqv
Evaluate the remainder MoD to be greater than or equal to> = logical implicit imp
Addition + Object Reference comparison is
Minus-
String connection &
When the multiplication and division numbers appear in the same expression at the same time, the multiplication and division operators are calculated from left to right. When addition and subtraction appear in an expression at the same time, the addition and subtraction operators are calculated from left to right.
The String concatenation (&) operator is not an arithmetic operator, but in the priority order, it is placed after all Arithmetic Operators and before all comparison operators. The is operator is an object reference comparison operator. It does not compare the values of objects or objects, but only checks whether two objects reference the same object.