Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class property bug?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Class property bug?
Divers
Thread ID:
00489001
Message ID:
00489001
Vues:
36
I came across an interesting anomaly with the Class property and was wondering if anyone else thought this was a bug. Try the following code:
------

LOCAL x, y
CLEAR

x = CREATEOBJECT("A")
? "x.name = " + x.name
? "x.class = " + x.class
?

y = CREATEOBJECT("C")
? "y.name = " + y.name
? "y.class = " + y.class

RELEASE x, y
RETURN

DEFINE CLASS "A" AS Custom
PROC Init
THIS.Name = "B"
ENDPROC
ENDDEFINE

DEFINE CLASS "C" AS Custom
Name = "D"
ENDDEFINE

-----
In the first example, class A returns a classname of “A” and a name of “B”, which is correct. In the second example, class C returns a classname of “D” and a name of “D”, which is dead wrong. Somehow, the class name is migrated to the name value. The code produces the same results under all version of VFP, including 7.

Thanks,
Keith
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform