-
recognizing null
I am trying to find a better way to recognize a null value than the one I am currently using:
For Each Feel In objInfo.Fields
*** If TypeName(Feel.Value) = "Null" Then
Response.write "<TD>   </TD>"
Else
Response.Write "<TD>" & Feel.Value & "</TD>"
End If
Next
This works...but I would rather use something more like VB...
If IsNull...I know that VBScript does not support this, but what are the alternatives? Thanks.
-
IsEmpty() does the same thing to my knowledge.
-
IsNull is part of VBscript and works under ASP pages both 2.0 and 3.0
I would use that
if it doesn't work your value is not really null
Most of the time ASP just does 0 length string
""
-
Or you can just do this:
For Each Feel In objInfo.Fields
strValue = Str(Feel.Value) & " "
Response.Write "<TD>" & strValue & "</TD>"
Next
Since HTML ignores whitespace, it will display the " " or the value.
Sastraxi: Empty is different from NULL..
-
How about:
If Len(something) = 0 Then ...
IIRC, that should work for Null or Empty Strings.