Or: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
''result'' = ''x'' OR ''y''
''result'' = ''x'' Or ''y''


'''Description'''
== Description ==


OR returns the logical disjunction of two expressions. ''result'' is TRUE, if one or both expressions ''x'' and ''y'' evaluate to TRUE, otherwise, ''result'' is FALSE.
Or returns the logical disjunction of two expressions. ''result'' is TRUE, if one or both expressions ''x'' and ''y'' evaluate to TRUE, otherwise, ''result'' is FALSE.


'''Example'''
== Example ==


<pre>
<pre>
REM OR Example
Rem Or Example
'OR performs logical and bitwise disjunction
'Or performs logical and bitwise disjunction
DIM Test1, Test2, Test3, x, y
Dim Test1, Test2, Test3, x, y
x = 1
x = 1
y = 5
y = 5
Test1 = x > 0 OR y < 10
Test1 = x > 0 Or y < 10
Test2 = x > 0 OR y > 10
Test2 = x > 0 Or y > 10
Test3 = x OR y
Test3 = x OR y
PRINT "Logical:"
Print "Logical:"
PRINT "  x > 0 OR y < 10 = " & Test1
Print "  x > 0 OR y < 10 = " & Test1
PRINT "  x > 0 OR y > 10 = " & Test2
Print "  x > 0 OR y > 10 = " & Test2
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 29: Line 29:
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[xor|XOR]]
[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[xor|XOR]]

Revision as of 02:38, 17 August 2012

result = x Or y

Description

Or returns the logical disjunction of two expressions. result is TRUE, if one or both expressions x and y evaluate to TRUE, otherwise, result is FALSE.

Example

Rem Or Example
'Or performs logical and bitwise disjunction
Dim Test1, Test2, Test3, x, y
x = 1
y = 5
Test1 = x > 0 Or y < 10
Test2 = x > 0 Or y > 10
Test3 = x OR y
Print "Logical:"
Print "  x > 0 OR y < 10 = " & Test1
Print "  x > 0 OR y > 10 = " & Test2

Output

Logical:
  x > 0 OR y < 10 = True
  x > 0 OR y > 10 = True

Related Items

AND, EQV, IMP, NOT, XOR