_asp basis of evaluation function for null value test of ASP

Source: Internet
Author: User

Copy Code code as follows:

' function: null-value Test
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


Tests whether the variable is null, and the meaning of the null value includes: The variable does not exist/is empty, the object is nothing,0, the empty array, the string is empty
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.