How to Return a Value from a FormID: Q126956 3.00 WINDOWS kbtool The information in this article applies to:
SUMMARYThis article describes a way to obtain a return value from a Form called with a DO FORM command.
MORE INFORMATIONSome operations require a return value from a Form. For example, a dialog box typically returns an answer from user input. The DO FORM command is used to instantiate a form designed with the Form Designer. The TO clause of the DO FORM command allows to specify a return variable. For example:
This statement returns a value to the cOkvar variable if a RETURN statement
is placed in the Unload method of a Form and the form is modal
(WindowType=1-Modal).
For more information about the DO FORM command, search using DO FORM in the FoxPro Help system. For information on calling a form as if it were a function, please see the following article in the Microsoft Knowledge Base:
The following step-by-step example illustrates how you can use a property
to hold the return value of a form.
Step-by-Step Example1. Create a form and place a text box on the form. 2. Add a command button to the form. Place the following command in the 3. Set the WindowType property of the form to Modal.
4. Click New Property from the Form menu to add a Custom Property to the 5. In the Click method of the command button, store the value of the text
6. Place the following command in the Unload method of the form:
7. Call the form by using the following command:
8. Type a value in the text box, and close the form. To verify the return
Additional reference words: VFoxWin 3.00
KBCategory: kbtool
KBSubcategory: FxtoolFormdes
|
Last Reviewed: May 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |