Share via


CLRInterop::isNull Method

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

Syntax

client server public static boolean isNull(CLRObject clrObject)

Run On

Called

Parameters

Return Value

Type: boolean
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++ null Nothing nullptr unit a null reference (Nothing in Visual Basic) in conditional statements that evaluate whether a CLR data type is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

Examples

The following example sets the CLR string data type to null Nothing nullptr unit a 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); 
}

See Also

CLRInterop Class

CLRInterop::Null Method