Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using program variables in forms
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00853514
Message ID:
00854266
Views:
24
Read Events and Clear Events are the key points here. Without them it would not work this way.

We have main application, which in turn calls sub-applications. Each sub-application receives parameters via parameter statement (so they would be private) into main program. The main program calls a form
do subappl with "Something", "Something"

subappl main program
parameters tcPar1, tcPar2

do form MainForm 

return
tcPar1, tcPar2 would be visible in form's load, but not other methods. I agree, the situation is slightly different with your example.


>Hi,
>
>>>If the program launches the form then, providing the program variables are >>not LOCAL, they will be visible within the form.
>
>>Actually, that's not true. Private variables would be visible in form's >Load, but they would not be visible in Form's Init and other methods... It >might depend on form's modality, though.
>
>Hmmm....
>
>PRIVATE myVar
>myVar = 4
>oForm = CreateObject("MyForm")
>oForm.Show()
>READ EVENTS
>
>DEFINE CLASS MyForm as Form
>PROC INIT()
>This.Caption = myVar
>ENDPROC
>PROC UNLOAD()
>CLEAR EVENTS
>ENDPROC
>ENDDEFINE
>
>
>Regards,
>Viv
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform