Previous Document Next Document

What query methods are supported for null objects?

All common query methods (see the section “What common query methods are supported?”) are supported for null objects.

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

When a null object is used with the comparison operators =, ==, <, >, >=, or <=, False is always returned. So, null = 5 returns False. The only exception is when comparing two null objects with = or ==, in which case the equality operators return True. The inequality operator <> always returns true when comparing a null object to non-null — unless both operands are null.

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 2007 Corel Corporation. All rights reserved.