PRB: Closeable Window Does Not CLEAR READ When Closed

Last reviewed: February 7, 1996
Article ID: Q109151
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

SYMPTOMS

When you define a window as closeable and use a READ command on that window, if a user clicks the close box in FoxPro for MS-DOS or chooses Close from the Control menu in FoxPro for Windows, the window will be deactivated but the READ command will not be cleared.

RESOLUTION

To clear the READ command, put a CLEAR READ command or a RETURN .T. command in the WINDOW DEACTIVATE clause of that window. When the user closes the window, the DEACTIVATE clause will execute and the READ command will be cleared. For example:

   CLEAR
   CLEAR ALL
   x=SPACE(20)
   DEFINE WINDOW aaa FROM 1,1 TO 20,60 FLOAT CLOSE
   ACTIVATE WINDOW aaa
   @ 5,5 GET x
   READ CYCLE DEACTIVATE testclose()

   Function Testclose
   if !WVISIBLE('aaa')
      clear read
      return .t.
   else
      return .f.
   endif


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.50b
KBCategory: kbprg kbprb
KBSubcategory: FxprgGeneral


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