Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a form in a class
Message
From
19/06/2000 19:10:10
 
 
To
14/06/2000 21:55:43
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00380150
Message ID:
00382010
Views:
22
>>I have a form in a class that I would like to return a value. But I can't figure out how I can do it. I have "return myretvalue" in the unload method of form but I don't know how to grab that value from the calling program. Here what I have so far:
>
>Show() the form modal, than when you've got your value on the form, Hide() it instead of Release()ing it, then you can access the forms properties from the calling program and release it. Check out either of the InPutBox() functions here in the Files Section for a good example.

Another possibility is to pass a reference to the calling object as input to the class at creation time; have the form populate a member of the passed object, creating it as necessary. For example, if the form is called from within another form, you could pass thisform in at creation time to have a property updated or added in the child. If you are not certain that you have an object reference to pass in, you can create an object in the caller's scope to act as a parameter object:

oDummyParmObj = CREATEOBJ('Line')
oDummyParmObj.AddProperty('uParmValue')
oDummyParmObj.uParmValue = NULL
oSubForm = CREATEOBJ('MyForm',oDummyParmObj)
oSubForm.Show()
uParmPassedBack = oDummyParmObj.uParmValue

In the subform's Init, save the object reference to a form property, and update the member through the saved object reference.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform