|
|
(6 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| ''result'' = NOT ''expression'' | | ''result'' = Not ''expression'' |
|
| |
|
| '''Description'''
| | == 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.
| | 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'''
| | == Example == |
|
| |
|
| <pre> | | <tabber> |
| REM NOT Example
| | JavaScript= |
| 'NOT does logical negation & bitwise inversion | | <syntaxhighlight lang="JavaScript"> |
| DIM Test1, Test2, Test3, x, y
| | // Not Example |
| | /* Not does logical negation & bitwise inversion */ |
| | |
| | var Test1, Test2, Test3, x, y; |
| | x = 3; |
| | y = 8; |
| | Test1 = !(x > 0); |
| | Test2 = !(y > 10); |
| | Test3 = !x; |
| | NSB.Print("Logical:"); |
| | NSB.Print(" Not(x > 0) = " + Test1); |
| | NSB.Print(" Not(y > 10) = " + Test2); |
| | </syntaxhighlight> |
| | |-| |
| | BASIC= |
| | <syntaxhighlight lang="vb.net"> |
| | Rem Not Example |
| | 'Not does logical negation & bitwise inversion |
| | Dim Test1, Test2, Test3, x, y |
| x = 3 | | x = 3 |
| y = 8 | | y = 8 |
| Test1 = NOT(x > 0) | | Test1 = Not(x > 0) |
| Test2 = NOT(y > 10) | | Test2 = Not(y > 10) |
| Test3 = NOT x | | Test3 = Not x |
| PRINT "Logical:"
| | Print "Logical:" |
| PRINT " NOT(x > 0) = " & Test1
| | Print " Not(x > 0) = " & Test1 |
| PRINT " NOT(y > 10) = " & Test2
| | Print " Not(y > 10) = " & Test2 |
| </pre> | | </syntaxhighlight> |
| | </tabber> |
|
| |
|
| '''Output'''
| | == Output == |
|
| |
|
| <pre> | | <pre> |
Line 29: |
Line 48: |
| </pre> | | </pre> |
|
| |
|
| '''Related Items'''
| | == Related Items == |
|
| |
|
| [[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[or|OR]], [[xor|XOR]] | | [[and|And]], [[eqv|Eqv]], [[imp|Imp]], [[or|Or]], [[xor|Xor]] |
|
| |
|
| [[Category:Language Reference]] | | [[Category:Language Reference]] |
|
| |
|
| [[Category:Logical Operators]] | | [[Category:Logical Operators]] |
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
// Not Example
/* Not does logical negation & bitwise inversion */
var Test1, Test2, Test3, x, y;
x = 3;
y = 8;
Test1 = !(x > 0);
Test2 = !(y > 10);
Test3 = !x;
NSB.Print("Logical:");
NSB.Print(" Not(x > 0) = " + Test1);
NSB.Print(" Not(y > 10) = " + Test2);
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
Related Items
And, Eqv, Imp, Or, Xor