Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initializing variable
Message
De
15/05/2006 10:57:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/05/2006 10:47:10
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:
01121913
Vues:
15
>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 tcSomeValue

* Create form property and store value
ThisForm.AddProperty("cSomeValue", m.tcSomeValue)


* Using the property in some other method
* Form.MyMethod()
MessageBox("The parameter passed was: " + ThisForm.cSomeValue)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform