Results 1 to 3 of 3

Thread: IsNothing(obj) vs. obj is nothing

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 .

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    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
  •  



Click Here to Expand Forum to Full Width