Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form that returns a value to a variable
Message
From
21/08/2000 15:36:53
 
 
To
21/08/2000 15:15:16
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00407476
Message ID:
00407484
Views:
28
>I know that it is possible to return a value from a form to a variable use code such as:
>
>do form c:\myform.scx to nValue
>
>However, this requires that I save the form and call it explicitly. I'd like to be able to create an instantiation of a form already existing in one of my class libraries and have it return a value to a varaible. Is this possible? if so how??
>
>TIA

First, the called form must be modal.
Second, don't Release() it like usual, but Hide() it; then you can access the form's return value property, e.g.

** in the modal form, I assume you'll have an OK button (or similar)
** in the modalform.cmdOK.Click()
** set the custom property uRetval
thisform.uRetVal = "Hello world."
thisform.Hide() && this is the key to it.


** to call the modal form
loForm = CREATEOBJECT("mymodalformclass")
loForm.Show()
** this code continues after above form's Hide() is performed
luRetVal = loForm.uRetVal
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform