0, "" (empty string), null, empty, difference between Nothing

zhaozj2021-02-17  46

0, "" (empty string), null, empty, difference between Nothing

First answer the following questions! After the following description, the variables A, B, C, D are equal to 0, respectively.

"", NULL, EMPTY, NOTING which one?

DIM A

DIM B AS STRING

DIM C AS Integer

DIM D As Object

A is equal to EMPTY because the "unstamined variable" that has not been initialized is equal to EMPTY. But if you check

TRUE values ​​can also be obtained by testing A = "" or A = 0.

B is equal to "", because the non-fixed length "word」 "that has not been initialized is equal to" "". But please pay attention

B <> NULL.

C is equal to 0, is this still problem?

D is equal to Nothing, the "object variable" that has not been set is equal to Nothing, but please

To use D = Nothing, use D is nothing to determine if D is equal to Nothing,

Because the symbols that determine if the equal symbol is Is not =.

The most confusing place is Null this reserved word, please see the following statement:

Print x = NULL

Print x <> null

The result is the output null (not true is not false), this is because any of the arithmetic

To contain null, the arithmetic format is equal to NULL, in fact, if you want to determine if a data is null

Never use:

IF x = null life 'will always get null

To use:

IF isnull (x) THEN

Which data will be equal to NULL? In addition to the NULL operation, it is not input.

"Data Field" (in the database) of the data is equal to NULL.

转载请注明原文地址:https://www.9cbs.com/read-30463.html

New Post(0)