您现在的位置是:网站首页> 编程资料编程资料
asp 空值测试判断函数_ASP基础_
2023-05-25
248人已围观
简介 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
相关内容
- asp仿php的一些函数分享_应用技巧_
- ASP调用远程XML数据的代码(alexa排名数据)_应用技巧_
- 判断dll文件是否已经注册的ASP函数代码_应用技巧_
- ASP读取Request.QueryString编码的函数代码_应用技巧_
- asp读取excel表名的实现代码_应用技巧_
- asp页面提示Response 对象 错误 ASP 0156 : 80004005 HTTP 头错误_应用技巧_
- Asp常见挂马方式大总结_木马相关_
- ASP网站出现 msxml3.dll 错误 80072ee7 错误的解决方法_应用技巧_
- 使用innerHTML时注意处理空格和回车符(asp后台处理)_应用技巧_
- ASP Eval、Execute、ExecuteGlobal区别分析_应用技巧_
