Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters from one form to another form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00170329
Message ID:
00170354
Vues:
29
>>>I tried to pass a set of parameters using the following command:
>>>=doform("MyForm",tParName1,tParName2,...)
>>>
>>>In the "MyForm" ini event, those parameters are defined but those parameters disappeared in the rest of the objects(like combox box) in "MyForm".
>>>
>>>Is there any way to setup those variables as public only in this form without setting a Property in the form?
>>
>>I'm sure there are other ways, but this should work:
>>
>>MyForm.Init()
>>LPARAMETERS lcParam
>>
>>PRIVATE pcParam
>>
>>pcParam = lcParam
>>
>>The pcParam should be visable to all lower routines.
>>
>>Is there some reason you don't want to use a property?
>
> I knew I should have tested this before posting. Sorry, that won't work. Use a property. PRIVATE variables are only visable to lower routines called from Init, not the whole form.
>
>You could, however (and I'm not saying it's a great coding practice), make the variable PRIVATE in the calling routine, put the value there, and use it in the new form.
>
>For example, in the click method of a button you could:
>
>PRIVATE pcVariable
>
>pcVariable="Hey, I can see this!"
>DoForm("MyForm")
>
>Now "MyForm" can see the "pcVariable" variable.

This is true if it is a MODAL form. A Non-MODAL form will just exit the calling routine and STILL not be able to access those PRIVATE variables.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform