Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VARTYPE vs TYPE with Parent property
Message
 
 
À
25/07/2002 15:48:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00682266
Message ID:
00682738
Vues:
30
Gordon,

It's obvious that you didn't test code you suggested and didn't read my post carefully. VARTYPE(THIS.Parent) would return Error "PARENT is not an object" if object doesn't have a parent.

>In your case, as well as the original thread, the Parent object would not exist nor would it result in a VARTYPE = "U". That is why I said to reverse the code.
>
>IF VARTYPE(THIS.Parent) = "O" && This fails
>ELSE
>ENDIF
>
>To....
>
>IF VARTYPE(THIS.Parent) <> "O" && This should not fail.
>ELSE
>ENDIF
>
>
>Because there is no Parent, the default error routine would fire on the object. If there is a Parent, then the Error routine for the Parent would fire.
>
>So IF you had an error routine on your Line object, the Error routine for the Line object would fire instead of the error routine of the parent.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform