Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I Return a Value From An Object
Message
 
To
18/06/2003 09:00:10
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00800953
Message ID:
00801138
Views:
17
David,

It seems your object is a form. One way to realize your goal is to use a parameter object.
loParm = CreateObject("MyParmClass")

loForm = CreateObject("MyFormObject",loParm)
loForm.Show()

...

somevalue = loParm.SomeProperty
loParm = NULL
MyParmClass would be a class defined with the property SomeProperty added to it (the base class is irrelavent). You recieve the parm object in the form's init and save a reference to it in a form property (which you have added to the form class for that purpose).
* Form's Init
LPARAMETERS poParm
This.oParm = poParm
Then from within the form you can refer to the parm object as Thisform.oParm.SomeProperty.

The big advantage of using this technique is that you are virtually unlimited on how many properties the parm object can have. Some can be values being passed into the form and others values returned by the form. Some of the properties of the parm object can even be arrays full of values.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform