XOR (boolean)

From QB64 Wiki
Revision as of 16:47, 18 March 2010 by imported>Cyperium (Created page with '{{KW|XOR (boolean)|XOR}} evaluates two expressions and if either of them is True then it returns True, if both of them are True then it returns False, if both of them are False t…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

XOR evaluates two expressions and if either of them is True then it returns True, if both of them are True then it returns False, if both of them are False then it returns False.


Syntax

condition XOR condition2


Description

  • Either condition or condition2 must be True for the evaluation to return True.
  • It is called extended OR because the conditions cannot both be True for it to return True like the OR evaluation.
  • condition and condition2 can themselves contain XOR evaluations.


Examples

Example: Dilemma...

True = NOT False AndersWon = True PeterWon = True IF AndersWon = True XOR PeterWon = True THEN PRINT "Thank you for your honesty!" ELSE PRINT "You can't both have won!" END IF


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page