Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Why "(Null == Null)" is "Null" instead of logically "True"?

Why on VB6 (Null = Null) is not logically True?

Please see http://img11.imageshack.us/img11/8053/34198907.jpg

(I just want to add some features to an old VB6 application I wrote few years ago.)

3 Answers

Relevance
  • mark r
    Lv 5
    1 decade ago
    Favorite Answer

    Null has no value so it isn't possible to compare Null with Null.

    you need to use the IsNull() function to get a True/False check.

    Note to people saying = means assignment here.

    In VBA and almost certainly VB6 = is a test rather than assignment.

    This is shown in a Microsoft example here:

    http://msdn.microsoft.com/en-us/library/752y8abs(V...

    In languages such as C++ == is used for equality tests but not in VB.

    Source(s): Microsoft and too many years writing VB code
  • Anonymous
    1 decade ago

    You used a single = operator which means you actually assigned the value of NULL to Null. Since NULL has no value, it returned False.

  • 1 decade ago

    One = or two? Usually assignment evaluates to whatever you assigned from.

    edit: screenshot says you're doing assignment, not comparison. That's your bug.

Still have questions? Get your answers by asking now.