How to Create a Foundation READ Time-Out

Last reviewed: April 29, 1996
Article ID: Q107837
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

A foundation READ is commonly used to provide a place for a menu to wait in an application (.APP) or executable file (.EXE) created by FoxPro. However, if the TIMEOUT clause is added to the foundation READ, the foundation READ will not work.

The foundation READ and the TIMEOUT clause will work correctly together if the VALID clause of the foundation READ calls a procedure instead of evaluating a variable, as shown below.

MORE INFORMATION

To create a menu with a foundation READ that works with the TIMEOUT clause, do the following:

  1. From the File menu, choose New, and select Menu. Choose OK.

  2. Add one or more pads to the menu. One pad should have QUIT as the menu prompt. Under Result, select Procedure, and enter the following code for the QUIT pad:

          m.quitting = .T.
          CLEAR READ ALL
    

  3. From the Menu menu, choose General Options. Select the Cleanup check box. In the cleanup code snippet window, enter the following code:

          m.quitting = .F.
          READ VALID quitting() TIMEOUT 10
    

          SET SYSMENU TO DEFAULT
    

          PROCEDURE quitting
          IF m.quitting
    
             RETURN .T.
          ELSE
             IF READKEY(0) = 6
                RETURN .T.
             ELSE
                RETURN .F.
             ENDIF
          ENDIF
    
    

  4. From the Program menu, choose Generate. When you are asked if you want to save the changes, choose Yes. Enter TIMEOUT as the menu name.

  5. In the Command window, enter the following command to display your custom menu:

          DO TIMEOUT.MPR
    

  6. Wait 10 seconds. The FoxPro default system menu should appear.


Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b time
read
KBCategory: kbprg
KBSubcategory: FxtoolGeneral


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 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.