Ghost全自动系统备份光盘正式版 V4.5 | 硬盘版 V2.0 | 排行榜 TOP50 | 图文推荐 | 玩小游戏
首页 >> Asp编程 >> Asp新手入门 >> ASP常用函数:IsBlank()

ASP常用函数:IsBlank()

作者:jumbot 来源:ZhouGuoQing's Blog 时间:2008-9-28 网友评论条 【

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

站长工具
搜索引擎收录情况:
相关文章
loading 请稍等,评论加载中...

Aspxhome.com. 中国Asp之家. 版权所有

闽ICP备06017341号