Q(uick)BASIC Syntax: Metacommand

Quick View

Metacommand Syntax

Metacommands begin with a dollar sign ($) and are always enclosed in a program comment

Worth knowing

Useful and cross-version information about the programming environments of QBasic and QuickBasic.

Description/Parameter(s)

More than one metacommand can be given in one comment. Multiple metacommands are separated by white-space characters: space, tab, or line feed. Metacommands that take arguments have a colon between the metacommand and the argument:

  • REM $METACOMMAND [:argument]

String arguments must be enclosed in single quotation marks. White-space characters between elements of a metacommand are ignored. The following are both valid forms for metacommands:

  • REM $STATIC $INCLUDE: 'datadefs.bi'
  • REM $STATIC $INCLUDE: 'datadefs.bi'
  • ' $STATIC $INCLUDE: 'datadefs.bi'
  • '     $STATIC    $INCLUDE: 'datadefs.bi'

Note that no spaces appear between the dollar sign and the rest of the metacommand.

If you want to refer to a metacommand in a description but do not want it to execute, place a character that is not a tab or space before the first dollar sign on the line. For example, on the following line both metacommands are ignored:

  • REM x$STATIC $INCLUDE: 'datadefs.bi'
Description/Parameter(s)
  • REM or ' enclose a metacommand in a program comment.
  • $metacommand is the name of one of the three BASIC metacommands ($STATIC, $DYNAMIC, and $INCLUDE).
  • $INCLUDE is the only metacommand that takes an argument (see $INCLUDE for details).

Usage Notes

  • Metacommands begin with a dollar sign ($) and are always enclosed in a program comment. More than one metacommand can be given in one comment. Multiple metacommands are separated by white-space characters: space, tab, or line feed. Metacommands that take arguments have a colon between the metacommand and the argument:

  • REM $METACOMMAND [:argument]

  • String arguments must be enclosed in single quotation marks. White- space characters between elements of a metacommand are ignored. The following are both valid forms for metacommands:

  • REM $STATIC $INCLUDE: 'datadefs.bi'
  • REM $STATIC $INCLUDE: 'datadefs.bi'
  • ' $STATIC $INCLUDE: 'datadefs.bi'
  • '     $STATIC    $INCLUDE: 'datadefs.bi'

  • Note that no spaces appear between the dollar sign and the rest of the metacommand.

  • If you want to refer to a metacommand in a description but do not want it to execute, place a character that is not a tab or space before the first dollar sign on the line. For example, on the following line both metacommands are ignored:

  • REM x$STATIC $INCLUDE: 'datadefs.bi'