473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

possible to use Bang ! notation in place of "Not" keyword?

If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but is
there any implementation of bang ! in VB.Net? Just checking. Any samples
appreciated.

Thanks,
Rich
Apr 27 '07 #1
6 1799
=?Utf-8?B?UmljaA==?= <Ri**@discussions.microsoft.comwrote in
news:E4**********************************@microsof t.com:
I realize that != is C# stuff and/or can be also be used in Tsql, but
is there any implementation of bang ! in VB.Net? Just checking. Any
samples appreciated.
That's C#.
Apr 27 '07 #2
On Apr 27, 12:22 pm, Rich <R...@discussions.microsoft.comwrote:
If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but is
there any implementation of bang ! in VB.Net? Just checking. Any samples
appreciated.

Thanks,
Rich
Perhaps you could define your own operators for !, !=, ==, ^, ||, &&, +
+, --, etc, but it seems like a pain to me.

Besides why not just do this?
if str != "something" Then
if str <"something" Then

Seems just as easy as using the C# notation to me.

Thanks,

Seth Rowe

Apr 27 '07 #3
I agree that <is just as easy !=. My issue was just to be more familiar
with VB.Net. So I was just checking if there was any implementation of !.
Like in VBA code you have Me!Text1, RS!fld1, ... so I am just checking if
there was any ! usage in VB.Net. It appears not - which is fine by me. But
I just wanted to make sure I'm not missing out on anything.

"rowe_newsgroups" wrote:
On Apr 27, 12:22 pm, Rich <R...@discussions.microsoft.comwrote:
If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but is
there any implementation of bang ! in VB.Net? Just checking. Any samples
appreciated.

Thanks,
Rich

Perhaps you could define your own operators for !, !=, ==, ^, ||, &&, +
+, --, etc, but it seems like a pain to me.

Besides why not just do this?
if str != "something" Then

if str <"something" Then

Seems just as easy as using the C# notation to me.

Thanks,

Seth Rowe

Apr 27 '07 #4
It's funny how those little things differ between languages. Until yesterday
I was still lamenting the fact that VB didn't have a ternary operator like C
does... testCondition?doIfTrue:doIfFalse;... but then I suddenly came upon
the IIF statement!

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
>I agree that <is just as easy !=. My issue was just to be more familiar
with VB.Net. So I was just checking if there was any implementation of !.
Like in VBA code you have Me!Text1, RS!fld1, ... so I am just checking if
there was any ! usage in VB.Net. It appears not - which is fine by me.
But
I just wanted to make sure I'm not missing out on anything.

"rowe_newsgroups" wrote:
>On Apr 27, 12:22 pm, Rich <R...@discussions.microsoft.comwrote:
If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but
is
there any implementation of bang ! in VB.Net? Just checking. Any
samples
appreciated.

Thanks,
Rich

Perhaps you could define your own operators for !, !=, ==, ^, ||, &&, +
+, --, etc, but it seems like a pain to me.

Besides why not just do this?
if str != "something" Then

if str <"something" Then

Seems just as easy as using the C# notation to me.

Thanks,

Seth Rowe

Apr 27 '07 #5
Peter wrote:
It's funny how those little things differ between languages. Until yesterday
I was still lamenting the fact that VB didn't have a ternary operator like C
does... testCondition?doIfTrue:doIfFalse;... but then I suddenly came upon
the IIF statement!
Be aware that currently (VB 2005) IIF is just a regular function. This
means that it will evaluate its parameters previous to execution,
which differs from the way the ternary "?:" operator works. For
instance, the assignment bellow will raise an error when executed,
because A(0) is evaluated before IIf is called.

Dim A As List(Of Integer)
Dim B As Integer = IIf(A is Nothing, 0, A(0))

Also, IIF parameters and return type are Object, which takes away most
of its mojo.

Next VB.Net version is supposed to remedy both issues. ;-)

Regards,

Branco.

Apr 27 '07 #6
"Rich" <Ri**@discussions.microsoft.comschrieb:
If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but is
there any implementation of bang ! in VB.Net? Just checking. Any samples
appreciated.

Note that C# overloads the '==' and '!=' operators so that they work with
both value types and reference types. Thus it's not obious if value
equality or object identity is compared. Other programming languages, such
as VB, provide different operators for comparing (1) value equality and (2)
object identity.

In VB, the operators '=' and '<>' are used to compare for value equality and
'Is' and 'IsNot' (VB 2005) are used to compare for object identity.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 28 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Karl Smith | last post by:
I heard a rumour that Opera succeeded where none have before, and implemented the tables described in HTML4 and CSS2. So I thought I'd try it out with the well known Periodic Table. ...
2
by: DC Gringo | last post by:
I have an image control (that pulls an image off an ESRI map server): <ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE> In the code behind I am setting the ImageURL to a String value...
2
by: Adam Short | last post by:
I've never needed it before but now I do! Does anyone know if you are able to perform a NOT Like search using Classic ASP ADO? i.e. myData.Filter = "Ref NOT LIKE '*1234*'" by the way this...
9
by: aden | last post by:
I have read the years-old threads on this topic, but I wanted to confirm what they suggest. . . Can the this pointer EVER point to a type different from the class that contains the member...
72
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
5
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
3
by: Tom | last post by:
Can someone please explain the non-working aspect of binding to Width? See code below. Thanks !! -- Tom =================================================== using System; using...
6
by: anton | last post by:
Hi, I want to replace all occourences of " by \" in a string. But I want to leave all occourences of \" as they are. The following should happen: this I want " while I dont want this \"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.