Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PASSING PARAMETERS TO A FORM
Message
 
À
03/11/1998 09:14:48
Noman Aftab
Embry-Riddle Aeronautical University
Daytona Beach, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00153897
Message ID:
00154035
Vues:
45
>HI! me again..
>THANKS for all the responses I am getting!!!!
>
>Back to my problem.... I passed parameters to a form and using PARAMETERS to store them as variables (which is global I presume) but the problem I am having is that I can use these variables in the INIT method, where I have stored these values but anywhere else in the form these variables are not found. Can anyone let me know why is thsi happening and how can I fix this.
>THANX!!!!
Noman --

George's and David's advice sounds best to me. Here is an example:

1. You call the form and pass a parameter: DO MyForm WITH 'Blue'.

2. Create a property in MyForm called fcMyColor.

3. In MyForm.Init(), set the form property to the value of the parameter:
LPARAMETERS m.tcMyColor
ThisForm.fcMyColor = m.tcMyColor

4. The form property fcMyColor now contains the parameter's value ('blue'). You can refer to it within any of the MyForm's methods as ThisForm.fcMyColor.

5. You can even refer to the property from outside of the form (in a report, for example) as MyForm.fcMyColor.

HTH -- Bill
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform