Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does VFP load class methods into memory?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01434853
Message ID:
01435169
Views:
45
Thank you for your input.

>The (2) is only partially correct. The properties are initialized only once when class definition is loaded in the memory first time. After that VFP creates new instances using cached class definition property values.
>
>oObj11 = CREATEOBJECT("Test1")
>? oObj11.tDt, oObj11.tDt
>
>INKEY(1)
>
>oObj = CREATEOBJECT("Test")
>? oObj.tDt		&& The same as in prefious object
>
>INKEY(1)
>
>oObj12 = CREATEOBJECT("Test1")
>? oObj11.tDt, oObj11.tDt	&& The same as in the first object
>
>DEFINE CLASS Test1 AS TEST
>	tDt2 = DATETIME()
>ENDDEFINE
>
>DEFINE CLASS Test AS Session
>	tDt = DATETIME()
>ENDDEFINE
>
>
>>
>>It goes without saying that (1) only the class definition is kept in memory (2) the object properties are not shared. Properties have to be initialized each time
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform