IsNullObject
Returns true if an variable is NULL, without testing the default property of the object being referenced.
Syntax
IsNullObject(<value>)
Parameters
<value>
Type: None
The value to test.
(return)
Type: Boolean
True if <value> is NULL, False otherwise.
Example
The following mrScriptBasic example uses the IsNullObject function to test if a variable is NULL:
Dim Identifier, Identifiers
Set Identifier = CreateObject("mrEvaluate.Identifier")
Set Identifiers = CreateObject("mrEvaluate.Identifiers")
Identifier.Name = "MyID"
Identifier.Value = NULL
Identifiers.Add(Identifier)
Set Identifier = Identifiers.FindItem("MyID")
If Identifier.IsNullObject() Then
Debug.Log("MyID not found")
Else
Debug.Log("MyID found")
End If
This script outputs the message “MyID found” because the value of Identifier is not NULL. However, if Identifier was tested using the following line instead, the message “MyID not found” is output:
If Identifier Is Null Then
This is because although Identifier is not NULL, the value of its default property (Identifier.Value) is NULL.
See also