Expressions and the $Null Property
Documentation | Blog | Demos | Support
Expressions and the $Null Property
5 out of 5 stars
1 rating
5 Stars | 100% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
An object that has not been assigned a value, or whose value is unknown, is considered to be $Null. For example, at the start of an application session, global variables do not have an assigned value, so each is considered $Null. If the name of an object with an unassigned or unknown value is used as an atomic expression, the expression is considered to be $Null.
The $Null property is special in two ways:
Any arithmetic or functional expression that contains a $Null value expression evaluates to $Null.
Any logic expression that contains a $Null value expression is considered logically false.
For example, if the variable Salary is $Null, then
Salary * 1.1 evaluates to $null, and Salary = 20000 is logically false.
However, you can successfully check if an expression is $Null. If Salary is $Null, then
Salary is $Null is logically true and Salary is not $Null is logically false.
Notice that conditional expressions involving the system variable $Null cannot use an = (equals) or <> (not equals) operator; instead, you must use the operator IS [NOT]. The use of IS and IS NOT emphasizes that $Null is a property and not a value.
Note: $Null can also be written Null.
5 out of 5 stars
1 rating
5 Stars | 100% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |