Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class property bug?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Class property bug?
Miscellaneous
Thread ID:
00489001
Message ID:
00489001
Views:
35
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
Map
View

Click here to load this message in the networking platform