Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best approach about #DEFINE constants
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01316940
Message ID:
01317654
Vues:
9
>>Not at all. I said leaving the properties on such a public object public is no better than public variables.
>
>In other words, in order to use constants in the application you would have to do something like
>
>oGlobal.GetPI()
>...
>
>Sounds inconvenient to me.
_Screen.AddProperty('GlobalConstants', Createobject('GlobalConstants'))

PI = _Screen.GlobalConstants.PI

? _Screen.GlobalConstants.PI
_Screen.GlobalConstants.PI		= 5
? _Screen.GlobalConstants.PI


define class GlobalConstants as Session
	PI = Pi()
	
	function PI_Assign(txNewValue)
		error 'PI is a Constant'
	endfunc
enddefine
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform