Microsoft KB Archive/32403

From BetaArchive Wiki
Knowledge Base


$PAGE Metacommand Puts Page Headers in Compiler Listings

Article ID: 32403

Article Last Modified on 11/21/2006

This article was previously published under Q32403

SUMMARY

You can use the REM $PAGE or '$PAGE metacommand to specify page headers in Macintosh QuickBASIC Compiler listing files. A listing file is created by selecting the Create Program List File option before compiling. Compiler listing files are given the extension "lst" by the compiler. This information applies to the Microsoft QuickBASIC Compiler Version 1.00 and the Microsoft BASIC Compiler Version 1.00 for Apple Macintosh.

MORE INFORMATION

The compiler replaces the REM $PAGE metacommand with a page header. Like other metacommands, the $PAGE metacommand must be the first word of a comment starting at the beginning of a line. If a $PAGE follows a single-quotation mark (') or REM that is not in the first column, the metacommand will be ignored.

Macintosh QuickBASIC 1.00 does NOT include a form feed character in the page header, since control characters may not be handled correctly by some text editors.

The Microsoft BASIC Interpreter Version 3.00 or QuickBASIC editor are unsuitable for printing or examining listing files. You may use the following programs to print out the program listing file:

  1. The "Print Listing File" program provided with QuickBASIC Version 1.00
  2. Edit (included on the compiler distribution disk)
  3. Microsoft Word for Apple Macintosh, or another text editor

The Print Listing File program is the most convenient because it automatically forces a new page at the beginning of a page header. If you are using Edit, Word, or another text editor, then you will have to insert page breaks yourself.

In the following example, the $PAGE metacommand is used to create a page header between the main program and the "print2:" subroutine when the compiler-listing (" lst") file is created. You may use either '$PAGE or REM $PAGE to force a page header:

FOR i = 1 TO 100
   PRINT "hello"
NEXT i
GOSUB print2
END
'$PAGE
print2:
   PRINT "in print2 subroutine"
   RETURN
                


Additional query words: BasicCom MQuickB

Keywords: KB32403