Information générale
Titre:
Class property bug?
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement