Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning value from Class
Message
From
17/11/1998 20:25:41
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, British Columbia, Canada
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00158041
Message ID:
00158595
Views:
21
Hi David,

I have a form class in a .vcx file. I have "return this.form_property_name" in the unload event.

I tried using "do form form_name to x1" as you show below, but it doesn't seem to work with forms in .vcx files.

I can start the form with:

oform1 = Createobject("form")
result = oform1.show()

However the value of result is .T., not the value I wanted returned.

I'm probably missing something simple. How do I get the returned value?

Thanks for your help.

Paul de Niverville


>Michael,
>
>>David, so your saying in the UNLOAD event I should be able to return 'something' from the form class unload event. I tried to return anything but only a logical true was passed back.
>
>Yes, you can return this.SomeFormProperty in the Unload event.
>
>I just created a form, dropped a textbox on it, bound the textbox to thisform.Tag.
>
>do form modal1 to x1
>? x1 && prints out whatever was typed in the textbox
>
>Here's the classbrowser output for the form:
>
>
PUBLIC oform1
>
>oform1=CREATEOBJECT("form1")
>oform1.Show
>RETURN
>
>**************************************************
>*-- Form:         form1 (e:\vfp5app\misc\modal1.scx)
>*-- ParentClass:  form
>*-- BaseClass:    form
>*
>DEFINE CLASS form1 AS form
>	DoCreate = .T.
>	Caption = "Form1"
>	WindowType = 1
>	Name = "Form1"
>
>	ADD OBJECT text1 AS textbox WITH ;
>		ControlSource = "thisform.tag", ;
>		Left = 34, ;
>		Top = 24, ;
>		Width = 297, ;
>		Name = "Text1"
>
>	PROCEDURE Unload
>		return this.Tag
>	ENDPROC
>ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform