Re: Selecting Proper Variables
From: Cor Ligthert (notfirstname_at_planet.nl)
Date: 08/29/04
- Next message: Arne Janning: "Re: annoyed with vb.net"
- Previous message: One Handed Man \( OHM - Terry Burns \): "Re: Make Program Restart"
- In reply to: Herfried K. Wagner [MVP]: "Re: Selecting Proper Variables"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Selecting Proper Variables"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 29 Aug 2004 16:23:08 +0200
OK
We have no difference in my opinion about that, I did not understand that
you was meaning "it can be" a null reference.
Therefore I use as well as Armin said String = ""
(As about in reallity about of course for very few things)
:-)
Cor
> >>
> >> They are not the same, 'Nothing' is a null reference, 'Empty', or '""'
> >> are not.
> >>
> > did I write Is Nothing?
> > Although = Nothing acts the same as Is nothing when there is no
reference.
>
> \\\
> Dim s1 As String = String.Empty
> MsgBox(s1.Length) ' 0.
> Dim s2 As String = Nothing
> MsgBox(s2.Length) ' 'NullReferenceException'.
> ///
>
> That's what I was talking about. If you compare a string that is
> holding a null reference to 'String.Empty', you will receive a 'True' as
> the result of the comparison. Nevertheless, both string variables
> behave differently.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
- Next message: Arne Janning: "Re: annoyed with vb.net"
- Previous message: One Handed Man \( OHM - Terry Burns \): "Re: Make Program Restart"
- In reply to: Herfried K. Wagner [MVP]: "Re: Selecting Proper Variables"
- Next in thread: Jay B. Harlow [MVP - Outlook]: "Re: Selecting Proper Variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|