VBScript Tutorials - Herong's Tutorial Examples - v6.02, by Herong Yang
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:
<html> <body> <!-- comparison_operation.html - Copyright (c) 1998 HerongYang.com. All Rights Reserved. --> <pre> <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) </script> </pre> </body> </html>
Here is the output of this VBScript example script:
True False False True True False
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
Introduction of VBScript - Visual Basic Scripting Edition
Variant Data Type, Subtypes, and Literals
►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
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
IE Web Browser Supporting VBScript