FIX: ON SHUTDOWN Command Produces "Syntax Error"

Last reviewed: October 20, 1997
Article ID: Q114234
2.60 MS-DOS kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:

  • Microsoft FoxPro for MS-DOS, version 2.6

SYMPTOMS

The ON SHUTDOWN command produces a "Syntax Error" error message when it is compiled or executed in FoxPro for MS-DOS.

CAUSE

This command is not supported in FoxPro for MS-DOS. This command is supported only in FoxPro for Windows and FoxPro for Macintosh. The concept of a shutdown event is not relevant in a single-tasking operating system such as MS-DOS.

RESOLUTION

Do not use this command in FoxPro for MS-DOS. When developing cross- platform applications, you can use the _DOS system memory variable to prevent the ON SHUTDOWN command from being executed when the code is executed under FoxPro for MS-DOS. For example:

   IF _DOS =.F.
        ON SHUTDOWN DO myprog
   ENDIF

Using this approach, the ON SHUTDOWN command will be executed only when the code is run under FoxPro for Windows or FoxPro for Macintosh.

STATUS

This problem was corrected in Microsoft FoxPro for MS-DOS version 2.6a. Because FoxPro 2.6a ignores the ON SHUTDOWN command, no syntax error occurs.


Additional reference words: FoxDos 2.60 buglist2.60 errmsg err msg
fixlist2.60a
KBCategory: kbprg kbfixlist kbbuglist kberrmsg
KBSubcategory:
Keywords : kbbuglist kberrmsg kbfixlist kbprg
Version : 2.60
Platform : MS-DOS
Solution Type : kbfix


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