Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing object as a parameter
Message
From
03/04/1997 17:12:16
 
 
To
03/04/1997 17:03:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00026905
Message ID:
00026910
Views:
26
>I am passing an object as a parameter like this:
>
>DO FORM TEST WITH ThisForm,This
>
>In my Test.Init(), I intercept the parameters as follow:
>
>PARAMETER oForm,oButton
>
>The problem is that those objects oForm and oButton will live during the Init() of the form Test but no longer after that. I tried to create 2 properties in Test and making the reference to them like this:
>
>ThisForm.oForm=oForm
>ThisForm.oButton=oButton
>
>but this didn't work.
>
>How can I make reference to those objects during the life time of the form Test?

I did it many times and it worked:
DO FORM newform WITH thisform.name,"text56"

In INIT() event
parameter cFormname,cControlname
this.otherform=cFormname
this.othercontrol=cControlname

And in some other event:
local cFormname,cControlname
cFormname=thisform.otherform
cControlname=thisform.othercontrol
&cFormname..&cControlname..value=...

Hopefully, it will help. I am leaving now. Good night.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform