Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Object running
Message
De
10/12/2001 16:51:37
 
 
À
10/12/2001 15:58:37
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00592094
Message ID:
00592404
Vues:
15
>Thanks for the help, but I am still not getting what I am looking for. I might be going about it the wrong way. Here is what I am doing.
>
>Dim oMapApp as Object
>
>' Is MapPoint Open or has oMapApp been assigned
>If VarType(oMapApp.Visible) = VariantType.Boolean 'Gives me an error
>End If
>
>If VarType(oMapApp) = VariantType.Object 'Returns True
> ' The above statement returns true because I dimmed it as an object, but
> ' I was hoping it would return false, since I haven't created the object
> ' yet. In FoxPro I would say - VARTYPE("oMapApp.Visible") = "L" - and
> ' if MapPoint was not created I was in business. What am I missing in
> ' VB, because it seems to be the same in VB.NET.
>Else
> oMapApp = CreateObject("MapPoint.Application")
>End If
>
>Thanks again for the help.
>
>Randy Belcher

Try this (although I don't recall if variants made it through VB.Net):
Dim oMapApp As Variant
If IsEmpty(oMapApp) Then
  'var has not been initialized
Else
  'variant can be checked with VarType() or TypeOf
End If
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform