Expressions and the $Null Property

Expressions and the $Null Property

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

Expressions and the $Null Property

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:

  1. Any arithmetic or functional expression that contains a $Null value expression evaluates to $Null.
  2. 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.
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish