网络编程
位置:首页>> 网络编程>> Asp编程>> ASP常用函数:IsBlank()

ASP常用函数:IsBlank()

作者:jumbot 来源:ZhouGuoQing's Blog 发布时间:2008-09-28 13:21:00 

标签:函数,asp

我们在编写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
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com