home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>Xor-Operator [Runtime]</title><meta name="filename" content="text/sbasic/common/03060600"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:to-be-embedded Eid="xor" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66621">Xor-Operator [Runtime]</help:link></p> <p class="Paragraph">Performs a logical Exclusive-Or combination of two expressions.</p> </help:to-be-embedded> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">Result = Expression1 Xor Expression2 <help:key-word value="Xor" tag="kw66621_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">Result: Any numeric variable that contains the result of the combination.</p> <p class="Paragraph">Expression1, Expression2 : Any numeric expressions to be combined.</p> <p class="Paragraph">A logical Exclusive-Or conjunction of two Boolean expressions returns <span class="T1">True</span> only if both expressions are different from each other.</p> <p class="Paragraph">A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions.</p> <p class="Paragraph"><span class="T1">Example:</span></p> <p class="PropText">Sub ExampleXor</p> <p class="PropText">Dim vA as Variant, vB as Variant, vC as Variant, vD as Variant</p> <p class="PropText">Dim vOut as Variant</p> <p class="PropText">vA = 10: vB = 8: vC = 6: vD = Null</p> <p class="PropText">vOut = vA > vB Xor vB > vC REM returns 0</p> <p class="PropText">vOut = vB > vA Xor vB > vC REM returns -1</p> <p class="PropText">vOut = vA > vB Xor vB > vD REM returns 0</p> <p class="PropText">vOut = (vB > vD Xor vB > vA) REM returns -1</p> <p class="PropText">vOut = vB Xor vA REM returns 2</p> <p class="PropText">End Sub</p> <p class="PropText"/> </body></html>