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

This article was previously published under Q50219
This article has been archived. It is offered "as is" and will no longer be updated.
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 theREM in the REM $INCLUDE: 'filename' statement (instead of on thefilename in the single quotation marks in QuickBasic 4.00, 4.00b, and4.50 and in QuickBasic extended shipped with Microsoft Basic PDSVersion 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 onthe File menu and select Include. Then when you try to execute theprogram in the editor, it will inform you to save the Include filebefore execution can occur, preventing the "File not Found" error.
QuickBas BasicCom

Article ID: 50219 - Last Review: 02/27/2014 18:29:38 - Revision: 1.2

  • kbnosurvey kbarchive KB50219