asp 空值测试判断函数

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了asp 空值测试判断函数脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

复制代码 代码如下:

'函数:空值测试
Function inull(Val)
Dim tmp
tmp = False
If IsNull(Val) Then
tmp = True
Elseif ISEMpty(Val) Then
tmp = True
ElseIf Trim(Val) = "" Then
tmp = True
End If
inull = tmp
End Function


测试变量是否为空值,空值的含义包括:变量不存在/为空,对象为Nothing,0,空数组,字符串为空
Function IsBlank(ByRef VAR)
IsBlank = False
Select Case True
Case IsObject(Var)
If Var Is Nothing Then IsBlank = True
Case IsEmpty(Var), IsNull(Var)
IsBlank = True
Case IsArray(Var)
If ubound(Var) = 0 Then IsBlank = True
Case IsNumeric(Var)
If (Var = 0) Then IsBlank = True
Case Else
If Trim(Var) = "" Then IsBlank = True
End Select
End Function

脚本宝典总结

以上是脚本宝典为你收集整理的asp 空值测试判断函数全部内容,希望文章能够帮你解决asp 空值测试判断函数所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: