VBScript has a complete set of operators, including arithmetic operators, comparison operators, connection operators and logical operators.
When the expression contains multiple operators, each part will be calculated in a predetermined order, which is called operator priority. You can use parentheses to bypass this priority order and force some parts of the expression to be evaluated first. When performing operations, always execute the operators in parentheses first, and then the operators outside parentheses. However, the standard operator precedence is still followed in parentheses.
When the expression contains multiple operators, the arithmetic operator is evaluated first, then the comparison operator, and finally the logical operator. All comparison operators have the same priority, that is, the comparison operators are calculated from left to right. The precedence of arithmetic and logical operators is as follows:
Arithmetic operator comparison operator logical operator
Description symbol description symbol description symbol
Exponentiation ^ equals = logical not
Minus sign – not equal to < > logic and and
Multiply * less than < logical or or
Division / greater than > logical XOR XOR
Integer division \ less than or equal to < = logical equivalent EQV
Remainder mod is greater than or equal to > = logical implicit imp
Plus + object reference comparison is
String connection &
When the multiplication sign and division sign appear in an expression at the same time, the multiplication and division operators are calculated from left to right. Similarly, when addition and subtraction appear in an expression at the same time, the addition and subtraction operators are calculated from left to right.
It comes before all arithmetic operators in the comparison string (&), but not before all arithmetic operators. The is operator is an object reference comparison operator. It does not compare objects or object values, but just checks to determine whether two object references refer to the same object.