Microsoft KB Archive/35825

From BetaArchive Wiki
Knowledge Base


Undocumented BC.EXE Metacommands That Affect .LST Listing

Article ID: 35825

Article Last Modified on 11/21/2006

This article was previously published under Q35825

SUMMARY

Placing the following metacommands into your source file affects the list (.LST) file generated by the compiler:

   REM $List
   REM $linesize
   REM $title
   REM $subtitle
   REM $page
   REM $pagesize
                

These metacommands are correctly documented in the "Microsoft QuickBasic Compiler" version 1.0x manual, and are used by the BASCOM.EXE compiler in QuickBasic versions 1.00, 1.01, and 1.02. Note that these metacommands do not apply to QuickBasic versions 2.00, 2.01, and 3.00, which do not output a source-listing .LST file.

The above metacommands work with the BC.EXE compiler that is provided with Microsoft QuickBasic versions 4.00, 4.00b, and 4.50; with Microsoft Basic Compiler versions 6.00 and 6.00b; and with Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2. However, these metacommands need to be added to the following manuals:

  1. "Microsoft QuickBasic 4.0: Basic Language Reference," Appendix C, "Metacommands," for versions 4.00 and 4.00b
  2. "Microsoft QuickBasic 4.5: Basic Language Reference," Appendix C, "Metacommands," for version 4.50
  3. "Microsoft Basic Compiler 6.0: Basic Language Reference," Appendix C, "Metacommands," for versions 6.00 and 6.00b
  4. "Microsoft Basic 7.0: Basic Language Reference" (metacommands are listed alphabetically) for Basic PDS versions 7.00 and 7.10.


MORE INFORMATION

REM $LIST{+ -}

The $LIST metacommand turns on and off portions of the source listing generated by the compiler. The $LIST metacommand has no effect on whether or not a source code listing is produced; it only affects what parts of the source code are placed in the listing. A source code listing is produced only if you request it when you start the compiler. To turn source code listing off at any point in the program, add the following line:

   REM $LIST-
                

To turn source code listing on at any point in the program, add the following line:

   REM $LIST+
                

The following metacommand sets the width of the listing output. Its default is 80 characters:

   REM $LINESIZE:n
                

The following is an example of how to set the list file to 132 columns:

   REM $LINESIZE:132
                

The following metacommand places a title on each page of the list (.LST) file:

   REM $TITLE:'text'
                

The following metacommand places a subtitle on all pages except the first:

   REM $SUBTITLE:'text'
                

The following metacommand forces a new page in the compiler listing file:

   REM $Page
                

The following metacommand forces a new page in the compiler listing after n minus 6 lines have been printed.

   REM $Pagesize:n
                


Additional query words: QuickBas BasicCom

Keywords: KB35825