加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

asp 空值测试确定性函数

发布时间:2023-06-21 13:48:24 所属栏目:Asp教程 来源:
导读:asp 空值测试判断函数,学习asp的朋友可以参考下。

复制代码代码如下:

'函数:空值测试

Function inull(Val)

Dim tmp

tmp = False

If IsNull(Val) Then

tmp = True

ElseIf IsEm
asp 空值测试判断函数,学习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
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章