Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass an object to a form
Message
From
14/11/2010 14:34:01
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01489074
Message ID:
01489077
Views:
77
>I have a summary form, which loads various detail forms. On the summary form, I have some objects that I would like to pass to the detail form in order to not reproduce logic. I know I can save those objects as a class and handle that way, but I'm wondering if this is possible?
>
>I know how to pass an object, but how to add that object to the detail form?


You can add custom property, pass object reference via init method and then store it to that custom property.
Then you can use/reference everything from that attached form.
*receiving form init
lparameters oSummaryForm  &&receive object reference
this.oSummaryForm=oSummaryForm  && Store it to custom property

*From here and on you can call/reference anything from that passed form anywhere in receiver form
SomeValue=thisform.oSummaryForm.SomeObject.SomeMethod()


**Before releasing form make sure you release reference of passed form as well
thisform.oSummaryForm=null
HTH
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Reply
Map
View

Click here to load this message in the networking platform