OpenOffice.org BASIC Guide - OpenOffice.org wiki
OpenOffice.org BASIC Guide - OpenOffice.org wiki
OpenOffice.org BASIC Guide - OpenOffice.org wiki
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Logical Operators<br />
Operators<br />
Logical operators allow you to do operations on elements according to the rules of Boolean algebra. If the<br />
operators are applied to Boolean values, the operation provides the result required directly. If used in conjunction<br />
with integer and long integer values, the operation is done at the bit level.<br />
AND And operator<br />
OR Or operator<br />
XOR Exclusive Or operator<br />
NOT Negation<br />
EQV Equivalent test (both parts True or False)<br />
IMP Implication (if the first expression is true, then the second must also be true)<br />
Comparison Operators<br />
Comparison operators can be applied to all elementary variable types (numbers, date details, strings, and Boolean<br />
values).<br />
= Equality of numbers, date values and strings<br />
Inequality of numbers, date values and strings<br />
> Greater than check for numbers, date values and strings<br />
>= Greater than or equal to check for numbers, date values and strings<br />
< Less than check for numbers, date values and strings<br />
3 Then<br />
B = 2<br />
End If<br />
The B = 2 assignment only occurs when value of variable A is greater than three. A variation of the If statement<br />
is the If/Else clause:<br />
If A > 3 Then<br />
B = 2<br />
Else<br />
Chapter 2 · The Language of <strong>OpenOffice</strong>.<strong>org</strong> <strong>BASIC</strong> 23