Edit: this is a serious question.
Edit: this is a serious question.
This is obviously at least five times as good as just having one option for null.
What is an array that is not empty but contains zero elements?
Here's an example:
' x can be anything, including an array, but
' defaults to the value Empty.
Dim x
' y is an array of values that can be anything,
' which defaults to an empty array.
Dim y()
' Initialize x as an empty array
x = Array()
' The following two statements print 0 and -1.
Debug.Print LBound(x)
Debug.Print UBound(x)
' The following two statements error with
' "Subscript out of range" even though y
' is also a kind of empty array.
Debug.Print LBound(y)
Debug.Print UBound(y)#define NULL 0 //C++
#define NULL ((void*)0) //C
I think later versions of C++ do something...different, but I’m not up to date enough to know without looking it up.
Also I think I vaguely remember from discussions about the standards, that a NULL pointer is not guaranteed to be numerically equal to zero in a standards compliant compiler.
But yeah, I was thinking of database NULLs.
edit: Also, null is not an empty string. The null character that terminates a string is unrelated to null pointers.
Null is the absence of a value. When used in a programming context it is either a pointer (which is not an integer or a float -- it's the pointer to the absence of an integer or a float. It is not equivalent to 0 or 0.0 or ""), a magic number (specifically for chars), or a special structure with a flag.
This more correctly would be "Default=0 Island". A database that doesn't have a nullable field would be the one where you'd have 0.0 as the defaults.
Pun.
Remember, a pointer contains the actual address in RAM, or 0 when the pointer is null.