KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q50219: Reasons for "File Not Found" Error Using $INCLUDE Metacommand

Article: Q50219
Product(s): See article
Version(s): 1.00 1.01 1.02 2.00 2.01 3.00 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom | mspl13_basic
Last Modified: 7-FEB-1990

The text file specified in a $INCLUDE metacommand must exist on disk,
or the message "File not found" appears.

You get the "File not found" message unless you do one of the following:

1. Qualify the filename with an explicit directory path in the
   $INCLUDE statement.

2. If an unqualified filename is specified in the $INCLUDE statement,
   the file must be in the current directory or the root directory. In
   addition, QuickBASIC Version 4.50 and Microsoft BASIC Professional
   Development System (PDS) Version 7.00 are enhanced to recognize the
   DOS INCLUDE environment variable (for both QB.EXE, QBX.EXE and
   BC.EXE) for unqualified $INCLUDE filenames. Both of these versions
   also let you set additional $INCLUDE file paths in the Options
   menu.

   The following products DON'T recognize the DOS INCLUDE environment
   variable to search for unqualified $INCLUDE filenames: Microsoft
   QuickBASIC Versions 1.00, 1.01, 1.02, 2.00, 2.01, 3.00, 4.00, and
   4.00b for MS-DOS, and Microsoft BASIC Compiler Versions 6.00 and
   6.00b for MS-DOS and MS OS/2.

If the file isn't found, a "File not Found" error is flagged on the
REM in the REM $INCLUDE: 'filename' statement (instead of on the
filename in the single quotation marks in QuickBASIC 4.00, 4.00b, and
4.50 and in QuickBASIC extended shipped with Microsoft BASIC PDS
Version 7.00).

To create an include file while in the QuickBASIC QB.EXE 4.00, 4.00b,
or 4.50 editor, or the QBX.EXE editor, use the Create File command on
the File menu and select Include. Then when you try to execute the
program in the editor, it will inform you to save the Include file
before execution can occur, preventing the "File not Found" error.

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.

Copyright Microsoft Corporation 1986-2002.