Logical Operators

Xojo Version 2021 r3.1

Description

Logical Operators let us compare Boolean expressions and then return a Boolean result. (True/False)

  • AND - both statements must be true
  • OR - only one statement must be true
  • NOT - reverses the value of statement - essentially the opposite.
  • xOR - one and only one statement must be true.. if both are true then its false
  • And Also - like AND but, if first expression is false, second expression is not evaluated
  • Or Else - like OR but, if first express is true, second expression is not evaluated

And Operator with an If Statement

If (a < 7) And (b > 12) then
 lstBox.AddRow("Bingo")
End If

Or Operator with an If Statement

If (state = "Florida") Or (state ="FL") then
 lstBox.AddRow("The state is Florida")
End If

Not Operator with an If Statement

If Not(temp < 32) then
 lstBox.AddRow("Warm")
End If