Information.IsNothing(Object) Metoda

Definice

Vrátí Boolean hodnotu, která označuje, zda k výrazu není přiřazen žádný objekt.Returns a Boolean value indicating whether an expression has no object assigned to it.

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

Parametry

Expression
Object

Povinná hodnota.Required. Object vyjádření.Object expression.

Návraty

Boolean

Vrátí Boolean hodnotu, která označuje, zda k výrazu není přiřazen žádný objekt.Returns a Boolean value indicating whether an expression has no object assigned to it.

Příklady

Následující příklad používá IsNothing funkci k určení, zda je objektová proměnná přidružena k libovolné instanci objektu.The following example uses the IsNothing function to determine if an object variable is associated with any object 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)

Poznámky

IsNothing Vrátí, True zda výraz představuje proměnnou objektu, ke které aktuálně není přiřazen žádný objekt. v opačném případě vrátí hodnotu False .IsNothing returns True if the expression represents an object variable that currently has no object assigned to it; otherwise, it returns False.

IsNothing je určeno pro práci na odkazových typech.IsNothing is intended to work on reference types. Typ hodnoty nemůže obsahovat hodnotu Nothing a vrátí výchozí hodnotu, pokud k ní přiřadíte hodnotu Nothing .A value type cannot hold a value of Nothing and reverts to its default value if you assign Nothing to it. Pokud zadáte typ hodnoty v Expression , IsNothing vždy vrátí False .If you supply a value type in Expression, IsNothing always returns False.

Platí pro

Viz také