VBS TUTORIAL: operator-comparison operator _vbs

Source: Internet
Author: User
Tags numeric numeric value

Comparison operators

Used to compare expressions.

result = expression1 comparisonoperator expression2

Result = Object1 is Object2

Parameters

Result

Any number.

Expression

Any expression.

Comparisonoperator

Any comparison operator.

Object

Any object name.

Description

The IS operator has a special comparison feature that differs from the operator in the following table. The following table contains a list of comparison operators, and a condition that determines whether result is True, False, or Null.

operator Description True If False if Null If
< Less than expression1 < expression2 expression1 >= expression2 expression1 or expression2 = Null
<= Less than or equal to expression1 <= expression2 expression1 > expression2 expression1 or expression2 = Null
> Greater than expression1 > expression2 expression1 <= expression2 expression1 or expression2 = Null
>= Greater than or equal to expression1 >= expression2 expression1 < expression2 expression1 or expression2 = Null
= Equals expression1 = expression2 expression1 <> expression2 expression1 or expression2 = Null
<> Not equal to expression1 <> expression2 expression1 = expression2 expression1 or expression2 = Null

When you compare two expressions, you may not be easy to determine whether the comparison expression is either numeric or as a string.

The following table describes how to compare expressions and the results of comparisons, depending on the subtype of the comparison.

if is
Two of expressions are numeric performs numeric comparisons.
All two expressions are strings Performs a string comparison.
An expression is a numeric value, plus an expression is a string A numeric expression is less than a string expression.
One expression is Empty and the other is numeric Performs a numeric comparison of 0 as the value of the Empty expression.
An expression is Empty and another expression is a string Performs a string comparison with a 0-length string ("") as the value of the Empty expression.
All two expressions are Empty Two expressions are equal.

Related Article

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.