ASP determines whether it is null and user-defined functions

Source: Internet
Author: User
ASP determines whether it is null and user-defined functions

ASP 08:38:33 read 12 comments 0 font size: large and small subscriptions

Determines whether the specified object is null, including most cases, such as empty arrays, empty strings, empty, and null objects.

01 Private Function IsBlank(byref TempVar)
02     IsBlank = False
03     Select Case VarType(TempVar)
04         Case 0, 1 '--- Empty & Null
05             IsBlank = True
06         Case 8 '--- String
07             If Len(TempVar) = 0 Then
08                 IsBlank = True
09             End If
10         Case 9 '--- Object
11             tmpType = TypeName(TempVar)
12             If (tmpType = "Nothing") Or (tmpType = "Empty") Then
13                 IsBlank = True
14             End If
15         Case 8192, 8204, 8209 '--- Array
16             If UBound(TempVar) = -1 Then
17                 IsBlank = True
18             End If
19     End Select
20 End Function

The vartype function returns the following values:

Constant Value Description
Vbempty 0 Empty (not initialized)
Vbnull 1 NULL (no valid data)
Vbinteger 2 Integer
Vblong 3 Long Integer
Vbsingle 4 Single-precision floating point number
Vbdouble 5 Double-precision floating point number
Vbcurrency 6 Currency
Vbdate 7 Date
Vbstring 8 String
Vbobject 9 Automation Object
Vberror 10 Error
Vbboolean 11 Boolean
Vbvariant 12 Variant (used only with the variable array)
Vbdataobject 13 Data Access Object
Vbbyte 17 Bytes
Vbarray 8192 Array

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.