The difference analysis of null,empty,nothing in ASP-application skills

Source: Internet
Author: User

In this paper, we introduce the sources and methods of null,empty,nothing of these kinds of null values in ASP.

Dim A
Dim B as String
Dim C as Integer
Dim D as Object


A is equal to Empty because the "unshaped variable" that has not yet been initialized equals Empty. However, if you detect a = "" or a = 0, you can also get a true value.
B equals "" because the unfixed length "string" that has not been initialized is equal to "". But please note b <> Null.
C equals 0, is this still a problem?
D equals Nothing, "object variables" that have not yet been set are equal to none, but do not use d = anything, but use D is nothing to determine if D equals anything, because the symbol that determines whether equality is not =.

The most confusing place is the Null Word, see the following statement:
Print X = Null
Print X <> Null
The result is output null (not true or false), because any expression that is null is equal to NULL, and in fact it is not possible to determine whether a data is null or not:
If X = null Then ' will always get null
and to use:
If IsNull (X) Then

Which data is equal to NULL? In addition to having a null expression, a data field (in the database) that does not enter any data is equal to NULL. That is, you can understand that null is the empty field that is read in the data.

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.