Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters from one form to another form
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00170329
Message ID:
00170353
Views:
17
>>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.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform