Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An easy one, I think
Message
From
26/03/1999 12:21:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/03/1999 11:57:31
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00202418
Message ID:
00202445
Views:
13
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform