Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Variables from Object to Form?
Message
From
20/03/1998 03:43:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00085886
Message ID:
00085897
Views:
28
>How do I return a variable From an Object to a Form?
>I made a Class based on Form consist of one text box and a label.
>I called the Object from My Form by clicking a command button.
>Obj=CreateObject("MyClass")
>Obj.show
>After I retreive a text , I'd like to pass this value to the Form
>Behind.
>How do I work this out?
>Thanx in advance.
>
>Yong Seung Kim
Hi Kim,
There are multipl ways to do it.
-Create a var. And in called object change this var.
myVar = ""
Obj=CreateObject("MyClass")
Obj.show
*Obj.custommethod (or a button click etc)
myVar = "myValue"
-Pass caller ref to object and let object to change a prop on caller
* Obj.init
lparameters oCaller
this.rCaller = oCaller   && Object custom prop to hold reference
* Obj.custommethod
this.rCaller.anyproperty.value = myValue
Obj=CreateObject("MyClass",this) && or thisform for form ref
Obj.show
-Create caller form with a name. So object can use it as a reference
do form myForm name referencedForm
* Obj.custommethod
referencedForm.anyprop = myValue
Obj=CreateObject("MyClass")
Obj.show
etc
How is it going in Korea. Have a nice day
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