Microsoft® Visual Basic® Scripting Edition
| Language Reference |
Used to compare expressions.
result = expression1 comparisonoperator expression2
result = object1 Is object2
result = string Like pattern
Comparison operators have these parts:
Part Description result Any numeric variable. expression Any expression. comparisonoperator Any comparison operator. object Any object name. string Any string expression. pattern Any string expression or range of characters.
The Is operator has specific comparison functionality that differs from the operators in the following table. The following table contains a list of the comparison operators and the conditions that determine 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 = Equal to expression1 = expression2 expression1 <> expression2 expression1 or expression2 = Null <> Not equal to expression1 <> expression2 expression1 = expression2 expression1 or expression2 = Null
When comparing two expressions, you may not be able to easily determine whether the expressions are being compared as numbers or as strings.
The following table shows how expressions are compared or what results from the comparison, depending on the underlying subtype:
If Then Both expressions are numeric Perform a numeric comparison. Both expressions are strings Perform a string comparison. One expression is numeric and the other is a string The numeric expression is less than the string expression. One expression is Empty and the other is numeric Perform a numeric comparison, using 0 as the Empty expression. One expression is Empty and the other is a string Perform a string comparison, using a zero-length string as the Empty expression. Both expressions are Empty The expressions are equal.
|file: /Techref/language/asp/vbs/vbscript/195.htm, 8KB, , updated: 1996/11/22 10:12, local time: 2018/1/19 02:02,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/language/asp/vbs/vbscript/195.htm"> Microsoft® Visual Basic® Scripting Edition </A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180119 David C Brown, Isaac M. Bavaresco, Manu Abraham, RussellMc, Van Horn, David, Harold Hallikainen, James Cameron, Sean Breheny, Dwayne Reid, John Gardner,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!