BC.EXE "$metacommand error" if $INCLUDE: '<filespec>' > 40 (73652)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1

This article was previously published under Q73652

SUMMARY

The BC.EXE compiler has a limitation of 40 characters for the filespec name in the metacommand $INCLUDE: '<filespec>'. If the filespec is greater than 40 characters, the BC.EXE compiler gives a "$metacommand error" warning, and the $INCLUDE file is not read.

This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS; Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2; and Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2.

MORE INFORMATION

The $INCLUDE statement has the following syntax:
   REM $INCLUDE: '<filespec>'
				
If the filespec exceeds 40 characters, the BC.EXE compiler will generate the error message "$metacommand error". This error message can be suppressed with the /T compile option, which may result in other error messages, such as "Type Mismatch" or "Type Not Defined". These errors are caused by the include file not being found. Also, any reference to TYPE...END TYPE and/or COMMON SHARED variables that are defined in the include file will not be found.

Note: The BC /T option was introduced in QuickBasic 4.0b and in Basic Compiler 6.0.

To work around the limitation, you can shorten the directory path name, and then set the "INCLUDE=" environment variable for MS-DOS to point to the directory of the include files, or copy the include files to a directory that is not as deeply nested.

Note that the QBX.EXE environment in Basic PDS does not have this limitation. QBX.EXE will find and read $INCLUDE files that are specified with a filespec greater than 40 characters.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB73652