General information
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only