Microsoft KB Archive/37425

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 14:13, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base

REM $INCLUDE Versus MERGE in QuickBASIC Compiler & Interpreter

Article ID: 37425

Article Last Modified on 1/8/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0

This article was previously published under Q37425


In Microsoft QuickBASIC for the Apple Macintosh, the REM $INCLUDE metacommand is only used in the compiler (as are other metacommands) and is ignored in the interpreter environment. Placing a REM $INCLUDE metacommand in your source file makes the compiler insert an external text file containing additional program code at compile time.

The MERGE command acts similar to the $INCLUDE metacommand; however, MERGE only works within the QuickBASIC interpreter environment. The MERGE command appends a text file to the end of the current source file in memory.


Using a combination of the $INCLUDE and $IGNORE metacommands, you can write a program source file that is compatible as both a compiled and interpreted program.

You can use the $INCLUDE metacommand to bring in compiler-specific code. The $IGNORE ON and $IGNORE OFF metacommands can be used to set aside code for the interpreter only. See the example code skeleton below.

The following is a code example:

REM $INCLUDE: 'text file for compiler only'
PRINT "This is only used in interpreter; compiler ignores this line.
PRINT "This is used by both compiler and interpreter."

Below is the $INCLUDE file, called 'text file for compiler only':

PRINT "This line is only included and executed in the compiled program."

Additional query words: MQuickB

Keywords: KB37425