CLRInterop.isNull(Object) Method

Definition

Confirms whether the specified CLRObject instance is set to nullNothingnullptrunita null reference (Nothing in Visual Basic).

public:
 static bool isNull(System::Object ^ clrValue);
public static bool isNull (object clrValue);
static member isNull : obj -> bool
Public Shared Function isNull (clrValue As Object) As Boolean

Parameters

clrValue
Object

Returns

true if the specified CLRObject instance is set to nullNothingnullptrunita null reference (Nothing in Visual Basic) or has not been initialized.

Remarks

The isNull method should be used instead of the X++ nullNothingnullptrunita null reference (Nothing in Visual Basic) in conditional statements that evaluate whether a CLR data type is nullNothingnullptrunita null reference (Nothing in Visual Basic).

The following example sets the CLR string data type to nullNothingnullptrunita null reference (Nothing in Visual Basic) and assigns the type value to the CLR object. It then calls the isNull method and prints the result in the Infolog.

static void Job5(Args _args) 
{ 
    System.String nullStr; 
    nullStr = CLRInterop::Null("System.String"); 
    print CLRInterop::isNull(nullStr); 
}

Applies to