Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you return data from a modal Form object?
Message
From
24/03/1998 06:28:51
Steve Camsell
Windmill Associates
Bath, United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00085149
Message ID:
00086649
Views:
34
Terrific!

I agree with Cetin's point about passing references about (much more elegant), but this is definitely a good trick to add to the arsenal.

>>I have been trying unsuccessfully to get a return value from a form created
>>I know there must be a better way.
>
>Whoa! Don't do Public! Try this:
>
>To return a value from a form
>
>1. Set the WindowType property of the form to 1 to make the form modal.
>2. In the code associated with the UnLoad event of the form, include a RETURN command with the return value.
>3. In the program or method that runs the form, include the TO keyword in the DO FORM command.
>
>For example, if FindCustID is a modal form that returns a character value, the following line of code stores the return value to a variable named cCustID.
>
>DO FORM FindCustID TO cCustID
>
>This was in VFP3 help but I couldn't find it in VFP5 help. ("help returning" at the command window.)
>
>I've used it several times & it works like a charm.
>
>JR
Steve Camsell
Development Consultant
Steve.Camsell@Windmill-DBM.Co.Uk
Previous
Reply
Map
View

Click here to load this message in the networking platform