473,785 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

If Not st1.Equals("som ething") 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 1825
=?Utf-8?B?UmljaA==?= <Ri**@discussio ns.microsoft.co mwrote in
news:E4******** *************** ***********@mic rosoft.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...@discussio ns.microsoft.co mwrote:
If Not st1.Equals("som ething") 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_newsgroup s" wrote:
On Apr 27, 12:22 pm, Rich <R...@discussio ns.microsoft.co mwrote:
If Not st1.Equals("som ething") 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?d oIfTrue:doIfFal se;... but then I suddenly came upon
the IIF statement!

"Rich" <Ri**@discussio ns.microsoft.co mwrote in message
news:14******** *************** ***********@mic rosoft.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_newsgroup s" wrote:
>On Apr 27, 12:22 pm, Rich <R...@discussio ns.microsoft.co mwrote:
If Not st1.Equals("som ething") 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?d oIfTrue:doIfFal se;... 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**@discussio ns.microsoft.co mschrieb:
If Not st1.Equals("som ething") 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
2823
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. http://users.tpg.com.au/karl6740/css/table_elements_periodic.html CSS: Notice in the TRs with the lanthanides and actinides, the empty TDs at the end taking the background colour of the TR? I say they shouldn't
2
1851
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 with url parameters like this: imgZonedCountry.ImageUrl = "http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y When it serves up the page, I'm getting "&amp;" in place of the "&"
2
5605
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 doesn't work!! and neither does myData.Filter = "Ref <> LIKE '*1234*'"
9
2184
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 function that the this pointer is being used in? That is, is the type of the this pointer always determined entirely syntactically (and never dynamically)? Example: if a member function is invoked on an object of class Apple (appleobj.drip_it() ),...
72
4236
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 c?
10
10053
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 believe that this has to do with unreleased form component events or event handlers. I'm comparatively new to .net and windows forms, in the sense that though I've been using them for over 2 years now, it's been rather sporadic. I work with...
5
6852
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 huge performance hit when I load the target table with "Not Null" constraints as compared to loading a target table without the constraints.
3
1581
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 System.Collections.Generic;
6
1401
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
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.