Not

From BR Wiki
Revision as of 14:32, 9 January 2012 by Mikhail.zheleznov (talk | contribs) (edit)
Jump to navigation Jump to search

The logical unary negation operator ~ reverses the meaning of its operand. The operand must be numeric. Note that in BR, 1 means true and 0 means false.

The ~ operator works as follows:

  • The result is true if the converted operand is false
  • The result is false if the converted operand is true.

The ~ operator is equivalent to the NOT operator, with one difference: ~ works everywhere whereas NOT will only work in If and PRINT statements

~ is usually used in conjunction with an If statement.