Operators
 

Here are the VB operators used to perform mathematical operations on one or more variables. Aside from the normal multiply/add/ substract and divide, you will find the AND, OR, Not Equal, MOD and Integer Division operators very useful.



  • / - Normal  division
  • \ - Integer division (truncates the answer)
  • ^ - Exponentiation operator
  • * - Multiply
  • + - Plus
  • - - Minus
  • = - Equal
  •  - Greater Than
  •  - Less Than
  •  - Not Equal
  • = - Greater than or equal
  • = - Less than or equal
  • AND - Defines a boolean value that is the AND of two values
    result = expression1 AND expression2

  • OR - Defines a boolean value that is the OR of two values result = expression1 OR expression2

  • XOR - Defines a boolean value that is the exclusive OR of two values result = expression1 XOR expression2

  • NOT - Defines an opposite boolean value
    A = NOT B

  • EQV - Performs a logical equivalence on two expressions (result is true if both expressions are true)

  • result = expression1 EQV expression2

  • IMP - Performs a logical implication on two expressions

    result = expression1 IMP expression2

  • IS - Determines if 2 variables reference the same object

    result = object1 IS object2

  • LIKE - Determines if one string matches a pattern
    result = string LIKE pattern

  • MOD - Returns the integer remainder of a division 
     i  = 27 MOD 5

(c) Shilpa Sayura Foundation 2006-2017