Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if var = nothing
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00413401
Message ID:
00414682
Vues:
13
>Hi Eric,
>
>Just tried and I am still getting an error. Compile Error: Variable undefined. And the IDE highlights the AcadCircle after the Is. Here is the code.
>General Section:
>
Private MarkObject As AcadCircle
>
>Public Sub UnMark()
>    If MarkObject Is AcadCircle Then
>        MarkObject.Delete
>        Set MarkObject = Nothing
>    End If
>End Sub
Have you made a reference to the component giving you the AcadCircle type?

You can also try to use the TypeName function like this:
Private MarkObject As AcadCircle

Public Sub UnMark()
    If typename(MarkObject) = "AcadCircle" Then
        MarkObject.Delete
        Set MarkObject = Nothing
    End If
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform