KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q35825: Undocumented BC.EXE Metacommands That Affect .LST Listing

Article: Q35825
Product(s): See article
Version(s): 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom docerr | mspl13_basic
Last Modified: 17-OCT-1990

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.

   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

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.