Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with initial value of property
Message
De
26/09/2012 10:31:07
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Problem with initial value of property
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01553671
Message ID:
01553671
Vues:
163
Hi all,

In the code hereunder the nStart property is set to the value of seconds() at the moment of creating the object. However, if I create another instance of the object (while the first is still active) the property does not get the value of seconds() of the moment of creation, but appears to be totally equal to the property of the first instance!

I imagine I can get around this by redeclaring it in the Init(). But why is this happening? Another bug or 'just' a quirck? Or is it by-design??
DEFINE CLASS cusLogFileHandler AS custom
	
	nHandle    = 0
	nErrors    = 0
	dStart     = date()		&& start date - required for calculation of elapsed time
	nStart     = seconds()
	cFileName  = ""

	PROCEDURE init( tcFileName, tlNew )
		local lcWhat

		with this
			*
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform