|
-
May 28th, 2001, 08:37 PM
#1
Thread Starter
Member
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.
-
May 28th, 2001, 09:15 PM
#2
Good Ol' Platypus
IsEmpty() does the same thing to my knowledge.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 28th, 2001, 09:26 PM
#3
Lively Member
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
""
-
May 29th, 2001, 01:51 AM
#4
Frenzied Member
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..
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 29th, 2001, 06:13 AM
#5
Black Cat
How about:
If Len(something) = 0 Then ...
IIRC, that should work for Null or Empty Strings.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
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
|