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:
00170396
Views:
20
>>>>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.

Yes. I guess I should have also mentioned that.
-Paul

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

Click here to load this message in the networking platform