我们在编写asp程序时经常会使用到这个功能,一般我们这样判断如:if a="" then ,而这个函数考虑的就比较全面了!
IsBlank()函数功能:判断某数是否为空
Function IsBlank(TempVar)
IsBlank = False
Select Case VarType(TempVar)
'Empty & Null
Case 0, 1
IsBlank = True
'String
Case 8
If Len(TempVar) = 0 Then
IsBlank = True
End If
'Object
Case 9
Dim tmpType
tmpType = TypeName(TempVar)
If (tmpType = "Nothing") Or (tmpType = "Empty") Then
IsBlank = True
End If
'Array
Case 8192, 8204, 8209
If UBound(TempVar) = -1 Then
IsBlank = True
End If
Case Else
IsBlank = True
End Select
End Function