VBScript has a complete set of operators, including arithmetic operators, comparison operators, join operators, and logical operators.
Operator Precedence
When an expression contains more than one operator, each part is evaluated in a predetermined order, which is called the operator precedence. You can use parentheses to cross this order of precedence, forcing some parts of an expression to be evaluated first. Operation, the operator in parentheses is always executed first, and then the operators outside the parentheses are executed. However, the standard operator precedence is still followed in parentheses.
When an expression contains more than one operator, the arithmetic operator is evaluated first, the comparison operator is computed, and the logical operator is finally computed. All comparison operators have the same precedence, that is, the comparison operator is computed in left-to-right order. The precedence of arithmetic operators and logical operators is as follows:
Arithmetic operator comparison operator logical operators
Descriptive symbol description Symbol description symbol
exponentiation ^ equals = logical Non-
Minus sign-not equal to <> logic and
Multiply * Less than < logical OR OR
except/greater than > Logical XOR
Integer division \ Less than equal <= logical equivalence EQV
The remainder Mod is greater than or equal to >= logic implied IMP
Plus + object reference comparison is
Reduction
string concatenation &
When multiplication and division appear in an expression at the same time, the multiply, except operators are computed in left-to-right order. Also, when addition and subtraction appear in an expression, the addition and subtraction operators are computed from left to right.
The string concatenation (&) operator is not an arithmetic operator, but in the order of precedence, it is ranked 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 simply checks to see whether two object references refer to the same object.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.