4D introduces a new Null type to ease the management of objects and collections. Thanks to the null value, you can represent a missing value and easily verify if your object or collection is correctly set.
The null type represents an unknown or a missing value.This type is special because it is impossible to cast to the null type or declare a variable of this type and it can be used just with object, collection, pointer and picture variables.
Be careful not to confuse the null value with an empty string or an integer with 0 for example, since 0 or “” are values.
Null is very useful in the case of a collection. Let’s examine a concrete example: since the the collection elements are not typed by default, it ain’t possible for 4D to set the elements with default values. No panic; Null value to the rescue!
How to set a null value?
You can simply use the new command: Null.
How to test null Values?
You can test null values with the Null command:
ALERT("Please enter a quantity")