Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











OPERATOR:  Or

Implemented in version 1.0
 
Or
 
The Or operator is used to perform a logical disjunction on two expressions, where the expressions are Null, or are of Boolean subtype and have a value of True or False.
 
The Or operator can also be used a "bitwise operator" to make a bit-by-bit comparison of two integers. If one or both bits in the comparison are 1, then a 1 is returned. Otherwise, a 0 is returned.
 
When using the Or to compare Boolean expressions, the order of the expressions is important.
 
Code:
<% =True Or True %>
<% =True Or False %>
<% =False Or True %>
<% =False Or False %>
 
<% =True Or Null %>
<% =Null Or True %>
<% =False Or Null %>
<% =Null Or False %>
<% =Null Or Null %>

 
Output:
True
True
True
False
 
True
True
(Null output)
(Null output)
(Null output)

 
In this example, the Or performs a bitwise comparison on the 1 (in binary 001) and the 2 (in binary 010), and returns a 3 (in binary 011).
 
Code:
<%
Expression1 = 1
Expression2 = 2
Result = Expression1 Or Expression2
Response.Write "Result = " & Result
%>

 
Output:
Result = 3


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information