The page you mentioned could be
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vagrpcomparison.asp
Nope. I seen that one and it isn't the same as the one in the help files
installed with Visual studio. Go to the Index and type in "<>" to get the
page on the said:
I think the better practice for beginners
is always initialize string variables in its
declaration statement, (dim sv as string="")
so there is no problem invoking string members.
Don't you think so?
Yes, but IMHO, it's also important for beginners to learn the difference
too.
Best Regards,
Trev.
"José Manuel Agüero" <jmaguero_vodafone.es> wrote in message
Hello, Trev:
The page you mentioned could be
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vagrpcomparison.asp
You can avoid the confusion with '=Nothing' and 'Is Nothing' if you take
into account that String is a class, so a non initialized string variable
contains a null reference, not a null string like in previous versions of
Basic.
So, use 'Is Nothing' only to check if a string variable has been
initialized, for example, before invoking a non shared method, like
MyStringVariable.Length; and avoid using =Nothing for strings, as it is
equivalent to ="" (or =string.empty) and these are clearer (in my opinion).
I think the better practice for beginners is always initialize string
variables in its declaration statement, (dim sv as string="") so there is no
problem invoking string members. Don't you think so?
Regards.
"Trev Hunter" <
[email protected]> escribió en el mensaje
| > Can you tell where in the helpfiles,
| > because I think this is completly nuts
|
| Look under the help for the "<>" or "=" operator. It's under the section
| about string comparison. I couldn't find the exact page in MSDN online,
but
| it is in the help files installed with Visual Studio.
|
| > If string Is nothing means that there is a
| > declared String withouth a
| > pointer to a virtual memoryadres
|
| I agree, but the implementation of the "=" and "<>" operators for strings
| does an extra check and returns True (or false for <>) for "" = Nothing.
|
| Note I'm talking about "=" and not "is". i.e.
|
| "" = Nothing returns true
| "" is Nothing returns false
|
| Dim szTest as String
|
| szTest = Nothing returns true
| szTest is Nothing returns true
|
| ' Assign szTest to an empty string
| szTest = ""
|
| szTest = Nothing returns true
| szTest is Nothing returns false
|
| I admit, this is slightly confusing, that's why I don't use this method -
| it's harder to read.
|
| HTH,
|
| Trev.