日期:2014-05-17  浏览次数:20830 次

ASP判断是否为空
判断是否为空常用如下方法
判断指定对象是否为空值, 包含大部分情况, 譬如空数组,空字符串,Empty和Null对象等等
Private Function IsBlank(byref TempVar)
	IsBlank = False
	Select Case VarType(TempVar)
		Case 0, 1 '--- Empty & Null
			IsBlank = True
		Case 8 '--- String
			If Len(TempVar) = 0 Then
				IsBlank = True
			End If
		Case 9 '--- Object
			tmpType = TypeName(TempVar)
			If (tmpType = "Nothing") Or (tmpType = "Empty") Then
				IsBlank = True
			End If
		Case 8192, 8204, 8209 '--- Array
			If UBound(TempVar) = -1 Then
				IsBlank = True
			End If
	End Select
End Function