Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initializing variable
Message
 
 
À
15/05/2006 10:57:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01121908
Message ID:
01121921
Vues:
12
>>how exactly does one initialise a variable inside a form?
>
>If it is to be used only within a method, the preferred method is to use a local variable. Example:
>
>
>local i
>for i = 1 to ...
>   ...
>next
>
>
>If you need a "variable" in several methods, use a form property. In the following example, the form receives some parameter in the Init() method, and uses it somewhere else.
>
>
>* Form.Init()
>* Receive parameter
>lparameters lcSomeValue
>
>* Create form property and store value
>ThisForm.AddProperty("cSomeValue", lcSomeValue)
>
>
>* Using the property in some other method
>* Form.MyMethod()
>MessageBox("The parameter passed was: " + ThisForm.cSomeValue)
>
Should this message be changed to use tcSomeValue for the parameter declaration? <g>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform