How do you do "is NOT equal to"?
if blah != blah then
blah
end if
??????
Printable View
How do you do "is NOT equal to"?
if blah != blah then
blah
end if
??????
A <> B
equal to
== or =
not equal to
<> or ><
greater
>
greater or equal
>=
less
<
less or equal
<=
yeah, it is <>
or you could do
Code:If Not myNum1 = myNum2 Then
You're thinking of C++Quote:
Originally posted by Edneeis
equal to
== or =
VB only supports =
It uses it as both an assignment operator and a truth operator.
Just clearing that up.
Even:
Code:If Not (Blah = Blah) then
blah
End If
ok, I think we might be confusing some people now!
Actually (to be ridiculously precise) VB lacks an assignment operator.Quote:
Originally posted by V(ery) Basic
VB only supports =
It uses it as both an assignment operator and a truth operator.
VB assigns values with the Let keyword accompanied with the equal sign.
But since the early days of BASIC the Let keyword kan be omitted. So we usually just type:Code:Let x = 5
But that doesn't make the equal sign an assignment operator.Code:x = 5
Because of VB's lack of an assignment operator assignments can only be done in the beginning of a statement and not in the middle.
The Let statement is medieval.
Try also using:
This boolean notation uses less code and executes faster.Code:If (variable) Then ... Else ...
'instead of:
If (variable <> 0) Then ... Else ...
[quote]
The Let statement is medieval.
Try also using:
code:-------------------------------------------------------------------------------- If (variable) Then ... Else ...
'instead of:
If (variable <> 0) Then ... Else ...
--------------------------------------------------------------------------------
This boolean notation uses less code and executes faster.
[\quote]
the boolean would only show true, and could not be used for comparison?
Yes, unfortunately, no comparison. But you can use this notation also when using the result from a Function as the boolean test.
If (Do_The_Test()) Then ...
yeah, but he was asking for the function of not equal to,
not true or false!
All right silvy, I was just mentioning this by increasing my replies. I want to be a guru too, you know?
yeah i know, but did you know, John (the administrator) has to make you a guru, based on your ability to post good helpful posts!
Is John's job vacant?
bad luck :( i don't think so :p