Scripting > UNICOM Intelligence Function Library > Miscellaneous functions > IsNullObject
 
IsNullObject
Returns true if an variable is NULL, without testing the default property of the object being referenced.
Syntax
IsNullObject(Val)
Parameters
Val
Type: None
The value to test.
(return)
Type: Boolean
True if Val 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 will correctly output 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” would be 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
Miscellaneous functions