Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Objects (forms) in arrays
Message
De
20/06/2000 14:49:32
 
 
À
16/06/2000 13:43:43
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00381535
Message ID:
00382318
Vues:
21
You got the error from the compiler or at runtime? If it's at the compiler level, you better post the code because you may have a syntax problem. Otherwise, here is what I do to check if an object has been instanciated correctly:
Dim loObj As MyObject.MyClass
Set loObj = Nothing
On Error Resume Next
Set loObj = New MyObject.MyClass
On Error GoTo 0

If loObj Is Nothing Then
   ' Error treatment goes here
Else
   ' OK, we may go on
End If
HTH
>My question is very simple: How can I check if an object has been set to Nothing? I already tried the obvious (i.e. "if myObject = Nothing then ...") but it didn't work because I'm not using the object correctly (at least, that's the message I got from the compiler).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform