ID: Q107837
2.50 2.50a 2.50b | 2.00 2.50 2.50a 2.50b | 2.50b
WINDOWS          | MS-DOS                | MACINTOSH
The information in this article applies to:
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.
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
   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
   to save the changes, choose Yes. Enter TIMEOUT as the menu name.
   custom menu:
      DO TIMEOUT.MPR
Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b time read KBCategory: kbprg KBSubcategory: FxtoolGeneral
Keywords          : FxtoolGeneral 
Version           : 2.50 2.50a 2.50b | 2.00 2.50 2.5
Platform          : MACINTOSH MS-DOS WINDOWSLast Reviewed: April 30, 1996