|
-
Jan 16th, 2004, 02:22 PM
#1
Thread Starter
Addicted Member
IsNothing(obj) vs. obj is nothing
So, I discovered recently VB.NET that IsNothing() is a function, and that, according to the help...
IsNothing returns True if the expression represents an Object variable that currently has no object assigned to it; otherwise, it returns False.
Is there a difference between using the 'IsNothing(obj)' function and using the 'obj is Nothing' syntax? Does VB.NET prefer one over the other?
Thanks
Wydok
"It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."
-John Von Neumann ca. 1949
-
Jan 16th, 2004, 02:33 PM
#2
Sleep mode
IsNothing is imported from VisualBasic namespace . It means it's for compatibilty issues .blah Is Nothing is the .NET way . Function , both gives same result .
-
Jan 16th, 2004, 03:00 PM
#3
Thread Starter
Addicted Member
OK, as long as both work. I'm confiused though since the IsNothing() function didn't exist in vb 6. The 'obj is Nothing' syntax is used instead.
Thanks
Wydok
"It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."
-John Von Neumann ca. 1949
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|