>I need to know if there is a way to return a value from a form with the code that is below, or if there is a better way to do this.
>
>oreport = CREATEOBJECT("myclass")
>oreport.show()
>
>Thanks a bunch,
>
>Jim
From another object ie:form,
oReport = createobject("myclass",this)
would pass obj ref to newform. Newform then get obj ref in init and store it to its custom property oCaller.
At any point newform could change, store, execute caller's PEM via thisform.oCaller.somePEM
* Refresh caller
thisform.oCaller.refresh()
* Change a prop. in caller
thisform.oCaller.mytxtbox.value = thisform.somevalue
* use and change an array of caller
dimension thisform.oCaller.aSomeArray[nRows,nCols]
thisform.oCaller.aSomeArray[nRow,nCol] = someexpr
If caller is not a form or formset, application object could serve as message storage.
* Main
oApp = createobject("myApp")
* newform
oApp.aMessageArray[nRow,nCol] = someretvalue
And of course defining variables before the newform make them accesible to newform too. In the same manner caller form could be instantiated with a name clause and newform could refer to it via "name" w/o storing to a custom property.
Personally I don't like traditional modal forms just returning a value in unload for its limiting capabilities (above approaches doesn't beat a modal form usage).
Cetin