Previous Document Next Document

Including queries in macros : Understanding the available query criteria : Querying null objects


Querying null objects

Null objects support all common query criteria (see Understanding the available query criteria).

You can call any method on a null object; the call will succeed, and value null will be returned. Thus, null.somemethod() returns null.

Using query operators with null objects

False is returned when a null object is used with the following comparison operators: =, ==, <, >, >=, and <=. For example, null = 5 returns False. However, please note the following exceptions:

 
When two null objects are compared by using the equality operator = or ==, True is returned.
 
When a null object is compared to a non-null object by using the inequality operator <>, True is returned.

Example
Result
null = 3
False
null = 'test'
False
null = null
True
null <> 3
True
null <> null
False
3 > null
False
null > null
False
null >= null
False

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.