Information.IsNothing(Object) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Restituisce un Boolean valore che indica se a un'espressione non è assegnato alcun oggetto.
public:
static bool IsNothing(System::Object ^ Expression);
public static bool IsNothing(object Expression);
static member IsNothing : obj -> bool
Public Function IsNothing (Expression As Object) As Boolean
Parametri
- Expression
- Object
Required.
Object espressione.
Valori restituiti
Restituisce un Boolean valore che indica se a un'espressione non è assegnato alcun oggetto.
Esempio
Nell'esempio seguente viene utilizzata la IsNothing funzione per determinare se una variabile oggetto è associata a qualsiasi istanza dell'oggetto.
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)
Commenti
IsNothing restituisce True se l'espressione rappresenta una variabile oggetto a cui non è attualmente assegnato alcun oggetto; in caso contrario, restituisce False.
IsNothing è progettato per lavorare sui tipi di riferimento. Un tipo di valore non può contenere un valore Nothing e ripristina il valore predefinito se lo si assegna Nothing . Se si specifica un tipo di valore in Expression, IsNothing restituisce Falsesempre .