Introduction to Numeric Comparison Operations

This section provides a quick introduction of numeric comparison operations supported by VBScript: Equal to, Not equal to, Greater than, Less than, Greater than or equal to, Less than or equal to.

Numeric comparison operations are operations that:

There are 6 numeric comparison operations supported in VBScript:

To show you how numeric comparison operations work, I wrote the following script, comparison_operation.html:

<!-- comparison_operation.html
 - Copyright (c) 2015,, All Rights Reserved.
<script language="vbscript">
   document.writeln(1 = 1)
   document.writeln(1 <> 1)
   document.writeln(9.9999e-1 > 9.99999e-1)
   document.writeln(9.9999e-1 < 1)
   document.writeln(9.9999e-1 >= 0.99999)
   document.writeln(1.00000001 <= 1)

Here is the output of this VBScript example script:


No surprises in the output. But the equal to operator sign (=) is identical to the assignment operator. We need to be careful.

Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

 Variant Data Type, Subtypes, and Literals

 Arithmetic Operations

Numeric Comparison Operations and Logical Operations

Introduction to Numeric Comparison Operations

 Introduction to Logical Operations

 String Operations - Concatenation and Comparison

 Variable Declaration and Assignment Statement

 Expression and Order of Operation Precedence

 Statement Syntax and Statement Types

 Array Data Type and Related Statements

 Array References and Array Assignment Statements

 Conditional Statements - "If ... Then" and "Select Case"

 Loop Statements - "For", "While", and "Do"

 "Function" and "Sub" Procedures

 Built-in Functions

 Inspecting Variables Received in Procedures

 Error Handling Flag and the "Err" Object

 Regular Expression Pattern Match and Replacement

 scrrun.dll - Scripting Runtime DLL Library

 Creating Your Own Classes

 IE Web Browser Supporting VBScript

 IIS ASP Server Supporting VBScript

 WSH (Windows Script Host)


 PDF Printing Version