Not: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
JwellsNB (talk | contribs)
No edit summary
 
Line 5: Line 5:
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 (Basic) ==
== Example ==


<pre>
<tabber>
Rem Not Example
  JavaScript=
'Not does logical negation & bitwise inversion
<syntaxhighlight lang="JavaScript">
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
</pre>
 
== Example (JavaScript) ==
<pre>
// Not Example
// Not Example
/* Not does logical negation & bitwise inversion */
/* Not does logical negation & bitwise inversion */
Line 35: Line 22:
NSB.Print("  Not(x > 0) = " + Test1);
NSB.Print("  Not(x > 0) = " + Test1);
NSB.Print("  Not(y > 10) = " + Test2);
NSB.Print("  Not(y > 10) = " + Test2);
</pre>
</syntaxhighlight>
|-|
BASIC=
<syntaxhighlight lang="vb.net">
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
</syntaxhighlight>
</tabber>


== Output ==
== Output ==

Latest revision as of 22:49, 24 July 2019

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