>>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.