VBScript tutorial Lesson 6 VBScript Operators

Source: Internet
Author: User
Tags arithmetic operators integer division

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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.