How to Create a Confirmation Screen Using Screen Builder

Last reviewed: April 30, 1996
Article ID: Q111669
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for Macintosh, version 2.5b

SUMMARY

Many applications use confirmation screens that present the user with push buttons to answer a question.

The steps below describe how to use the Screen Builder to create a confirmation screen containing Yes and No push buttons.

MORE INFORMATION

Sample Confirmation Screen with Yes and No Push Buttons

  1. Type the following in the Command window to start the Screen Builder:

    CREATE SCREEN

  2. Place a text field on the screen. (In FoxPro for Windows or FoxPro for Macintosh, select the Text tool from the toolbox. In FoxPro for MS-DOS, choose Text from the Screen menu.)

  3. In the text field, type the question asked of the user. For this example, type the following:

    Save changes?

  4. Place a push button on the screen. (In FoxPro for Windows or FoxPro for Macintosh, select the Push Button tool from the toolbox. In FoxPro for MS-DOS, choose Push Button from the Screen menu.)

  5. Under Push Button Prompts, type "\!\<Yes" (without the quotation marks)in the first column.

    NOTE: The backslash and exclamation mark characters (\!) at the beginning of the push button prompt designate this push button as the default. The backslash and less-than characters (\<|) in front of the letter Y designate Y as the access key (also known as a hot key.)

  6. Move down to the second row under Push Button Prompts. Type "\?\<No" (without the quotation marks) in the second prompt area.

    NOTE: the backslash and question mark characters (\?) at the beginning of the push button prompt designate it as the escape or cancel push button. The backslash and less-than characters (\<|) in front of the letter N designate N as the access key.

  7. In the Variable text box, type "m.confbtn" (without the quotation marks).

  8. Under Clauses, choose Valid.

  9. Verify that the Procedure radio button is selected, then type the following in the text editing region:

    IF m.confbtn = 1

              * Place the code performed when "Yes" is chosen here.
           ELSE
              * Place the code performed when "No" is chosen here.
           ENDIF
    
           CLEAR READ
    
    

  10. Choose OK twice to return to the Screen Design window.

  11. From the Program menu, choose Generate.

  12. When prompted to save changes to the screen, choose Yes, then save the screen with the name TEST.

  13. When prompted to save environment information, choose No.

  14. In FoxPro for Windows and FoxPro for Macintosh, choose the More button in the Generate Screen dialog box to view all Generate options. (FoxPro for MS-DOS automatically displays all Generate options.)

  15. Clear the Open Files and Close Files check boxes.

  16. Choose the Generate button.

  17. Run TEST.SPR to test the screen.

NOTE: If the screen appears briefly, then clears before a push button has been selected, add the following code to the screen's Setup snippet in order to initialize the push button variable:

   m.confbtn = 1


Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b ok
cancel
KBCategory: kbui kbtool kbprg kbcode
KBSubcategory: FxtoolSbuilder


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.