Information.IsNothing(Object) 메서드

정의

식에 할당된 개체가 있는지 여부를 나타내는 Boolean 값을 반환합니다.

public:
 static bool IsNothing(System::Object ^ Expression);
public static bool IsNothing (object? Expression);
public static bool IsNothing (object Expression);
static member IsNothing : obj -> bool
Public Function IsNothing (Expression As Object) As Boolean

매개 변수

Expression
Object

필수 요소. Object 식입니다.

반환

식에 할당된 개체가 있는지 여부를 나타내는 Boolean 값을 반환합니다.

예제

다음 예제에서는 함수를 IsNothing 사용하여 개체 변수가 instance 개체와 연결되어 있는지 확인합니다.

Dim testVar As Object
' No instance has been assigned to variable testVar yet.
Dim testCheck As Boolean
' The following call returns True.
testCheck = IsNothing(testVar)
' Assign a string instance to variable testVar.
testVar = "ABCDEF"
' The following call returns False.
testCheck = IsNothing(testVar)
' Disassociate variable testVar from any instance.
testVar = Nothing
' The following call returns True.
testCheck = IsNothing(testVar)

설명

IsNothingTrue 식이 현재 할당된 개체가 없는 개체 변수를 나타내면 를 반환하고, 그렇지 않으면 를 반환합니다False.

IsNothing 는 참조 형식에서 작동하기 위한 것입니다. 값 형식은 Nothing 값을 보유할 수 없으며 할당 Nothing 하는 경우 기본값으로 되돌아갑니다. 에 값 형식을 제공하는 경우 항상 을 ExpressionIsNothing 반환합니다False.

적용 대상

추가 정보