Forum Discussion

sastowe's avatar
sastowe
Super Contributor
13 years ago

VBScript engine? - I have never seen this before

I don't think in my years as an ASP programmer that I have ever seen this.



 If rs("ValOne").Value = itE.Value("ValeOne") AND rs("ValeTwo").value = itE.Value("ValTwo")



I was troubleshooting why this was not evaluating to true when I thought it should be. I have

rs("ValeTwo").value

itE.Value("ValTwo") and

rs("ValeTwo").value = itE.Value("ValTwo")



In the debugger. The first two are showing null, as is the equality test. If both values are null why would they not be equal and the equality evalutaion not return true?



Am I losing my mind? I am probably being dumb.

2 Replies

  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor
    Hi Stephanie



    When a variable is assigned a null value, the VBScript engine doesn't actually know what its value is, therefore two null variables cannot be considered equal, hence your 'False' result.



    There is a good article on this Microsoft site that explains it very well:



    http://technet.microsoft.com/en-us/library/ee198856.aspx



    Hope this helps.



    Regards

    Stephen.