Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variables in form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01273093
Message ID:
01273096
Vues:
9
>If I declare a variable in init event of a form
>this variable is not found in a button or other object of the form
>
>I have to declare it as public
>
>Is it really necessary to declare the variable as public ?

Yes (if you want to use VARIABLE). The variable is scoped to current code portion if it is not declared as PUBLIC (Grrrrr).
If you want something which is accessible in all form methods and events better use form property:
***  Init event of the form:
thisform.AddProperty([property name here], property value here)
But you should reference that property (when you need it) no only with its name but with thisform. infront of it:
***  Init event of the form:
thisform.AddProperty([MyProperty], -777)


*** Somewhere else where you need that value:
LOCAL lntest
lntest = 123123/thisform.MyProperty*3.14
WAIT WINDOW lntest 
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform