Difference between revisions of "OR (boolean)"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
(Created page with 'The '''OR''' coditional operator adds an alternative in a IF...THEN or Boolean statement. * OR adds an alternative to another conditional evaluation. * Parenthesis may…')
 
imported>Clippy
Line 11: Line 11:
 
:a% = 100
 
:a% = 100
 
:b% = 50
 
:b% = 50
 
  
 
: IF (a% > b% AND a% < 100) OR b% = 50 THEN PRINT "True"
 
: IF (a% > b% AND a% < 100) OR b% = 50 THEN PRINT "True"

Revision as of 23:12, 6 September 2009

The OR coditional operator adds an alternative in a IF...THEN or Boolean statement.


  • OR adds an alternative to another conditional evaluation.
  • Parenthesis may be used to clarify an evaluation.


Example:

a% = 100
b% = 50
IF (a% > b% AND a% < 100) OR b% = 50 THEN PRINT "True"


Screen results: True


Explanation: The first evaluation was False, but the OR evaluation made the statement true and the code was executed.


See also: AND (boolean)


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage