Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Questions
Message
From
22/01/1999 12:03:27
 
 
To
22/01/1999 11:22:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00177951
Message ID:
00179004
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
>
>In this example you have only one property, which is different in any subclass of the initial class. The whole chain is loaded, and all the definitions are here. What I'm supposing, is that if there was some Prop2, which was redefined only at B and D level, and overrriden in the object itself, wouldn't use any space in C level, and if it wasn't redefined in object x, wouldn't have space allocated in that object either. Is there a way to measure this?

Wouldn't ALL object have to have the space allocated for the properties, since they could change the value after it's instanciated? The non-default properties would only be initialized with the inherited value, but they would still be separate from the base class properties. Changing any one of the objects other properties would effect only that object, so they must have separate space allocated for each object's properties.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform