Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Questions
Message
 
 
To
21/01/1999 18:27:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00177951
Message ID:
00178796
Views:
44
Dragan,

A copy of all object properties are loaded for each class of the inheritance tree, not just the non-default ones. An object though has it's own memory where all the properties are stored. You can see this by using the scope resolution operator to access them (but at the moment I can't recall the correct syntax), or via the PEMSTATUS() that can tell if something is non-default, and GETPEM() will show it. For example

x = createobject( "d" )
? x.Prop1
? getpem( x, "prop1" )
? getpem( "d", "prop1" )
? getpem( "c", "prop1" )
? getpem( "b", "prop1" )
? getpem( "a", "prop1" )

define class a as custom
Prop1 = "Class A"
enddefine

define class b as a
Prop1 = "Class B"
enddefine

define class c as b
Prop1 = "Class C"
enddefine

define class d as c
Prop1 = "Class D"
enddefine

>My rule of thumb is that code has to be loaded, and it's loaded only once. Therefore, for each object, VFP must load its class definition; if it's already there (because we already have an object of the same class in memory), it doesn't load it again. It must create an instance, which probably contains the non-default properties (.parent, .value, .left, .top etc).
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform