Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does VFP load class methods into memory?
Message
 
 
À
16/11/2009 09:31:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01434853
Message ID:
01435150
Vues:
88
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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform