Not: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
''result'' = NOT ''expression'' | ''result'' = NOT ''expression'' | ||
== Description == | |||
Not returns the logical negation of an expression. The required argument, ''expression'', is any valid expression. ''result'' is TRUE if ''expression'' evaluates to FALSE, FALSE if ''expression'' evaluates to TRUE, ''result'' is NULL otherwise. | |||
== Example == | |||
<pre> | <pre> | ||
Rem Not Example | |||
' | 'Not does logical negation & bitwise inversion | ||
Dim Test1, Test2, Test3, x, y | |||
x = 3 | x = 3 | ||
y = 8 | y = 8 | ||
Test1 = | Test1 = Not(x > 0) | ||
Test2 = | Test2 = Not(y > 10) | ||
Test3 = | Test3 = Not x | ||
Print "Logical:" | |||
Print " NOT(x > 0) = " & Test1 | |||
Print " NOT(y > 10) = " & Test2 | |||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Line 29: | Line 29: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[or|OR]], [[xor|XOR]] | [[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[or|OR]], [[xor|XOR]] |
Revision as of 02:23, 17 August 2012
result = NOT expression
Description
Not returns the logical negation of an expression. The required argument, expression, is any valid expression. result is TRUE if expression evaluates to FALSE, FALSE if expression evaluates to TRUE, result is NULL otherwise.
Example
Rem Not Example 'Not does logical negation & bitwise inversion Dim Test1, Test2, Test3, x, y x = 3 y = 8 Test1 = Not(x > 0) Test2 = Not(y > 10) Test3 = Not x Print "Logical:" Print " NOT(x > 0) = " & Test1 Print " NOT(y > 10) = " & Test2
Output
Logical: NOT(x > 0) = False NOT(y > 10) = True