Information.IsNothing(Object) Méthode

Définition

Retourne une Boolean valeur indiquant si une expression n’a pas d’objet affecté à celui-ci.

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

Paramètres

Expression
Object

Required. Expression Object.

Retours

Retourne une Boolean valeur indiquant si une expression n’a pas d’objet affecté à celui-ci.

Exemples

L’exemple suivant utilise la IsNothing fonction pour déterminer si une variable d’objet est associée à une instance d’objet.

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)

Remarques

IsNothing retourne True si l’expression représente une variable d’objet qui n’a actuellement pas d’objet affecté à celui-ci ; sinon, elle retourne False.

IsNothing est destiné à travailler sur les types de référence. Un type valeur ne peut pas contenir une valeur Nothing et rétablit sa valeur par défaut si vous l’affectez Nothing . Si vous fournissez un type valeur dans Expression, IsNothing retourne Falsetoujours .

S’applique à

Voir aussi