Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling a form as a function
Message
From
05/12/1997 13:06:12
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00064057
Message ID:
00064064
Views:
20
>I have a VFP form that I would like to have return a value. I know that I can put RETURN (value) in the Unload event of the form, but what is the form calling syntax? With old .SPRs I just created a .PRG and called it like so:
>
>IF MyDialog() = 1
>   ...
>ENDIF
>
>
>How do I do this with a VFP form?
>
>TIA

Put RETURN(THIS.ValueToReturn) in the UnLoad Event of the form.
*You can't return the Value property of an object on the form because the Destroy Event for all form objects has already occured.
*Put the value to be returned in a form property. (lika 'Tag')
The form's WindowType property needs to be set to 1-Modal.

Now that we've got the form built, we need to know how to call it. Call the form with:

DO FORM InputForm TO gcInput

InputForm is the name for the for and gcInput is where the value will be placed.
Previous
Reply
Map
View

Click here to load this message in the networking platform