*************************************************************** * LISTRCMD.C is a sample setup or command file that might be * * used to print C program listings. The only part that is * * unique to the C language is the definition of AltCmdLead * * to allow LISTR commands in the listed file. The rest of * * this command file might be used with any ASCII file. * * * * This file sets the printer up to print at 12 characters * * per inch, and 8 lines per inch. This allows lines with up * * to 86 characters to print without wrapping, and gets * * nearly 80 lines on the page. You will undoubtedly have to * * modify the printer control codes to suit your printer. * * * * LISTR will use this command file while printing any file * * with the .C extension if this command file is in the * * current directory, or in the directory pointed to by the * * LISTRCMD variable in the DOS environment. See the COMMAND * * FILES section of LISTR.DOC for more information. * *************************************************************** * bwm 2-22-92 * *************************************************************** * * Start each included file (if any) with page number 1 * ..NewFilePg 1 * * Setup the page to handle 12 cpi printing. Uses 86 text * columns, with a left margin of 8 characters. PageCols * must be set to 102 (or greater than 86+8 at least) before * setting TextLen to avoid an error. * ..PageCols 102 ..TextLen 86 ..LeftMgn 8 * * Set the page length and bottom line for 8 lpi printing. * PageLines must be set before BotLine to avoid an error. * ..PageLines 88 ..BotLine 83 * * Include a top title with the file name, date and time * ..Title 2 /Listing of//@Mfn: @mdl: @mt12:/ * * Include a bottom title with listing date and time, and * the page number. * ..Title 85 /Listed @cdl: at @ct12://Page @pg/ * * Turn Wrap on, so long lines will not be truncated. * Setting WrapIndent to 2 causes the wrapped part of a * line to be indented relative to the first character * on the first part of the line. * ..Wrap ON ..WrapIndent 2 * * Set the alternate command lead to '/*!' so that LISTR * commands can be included in the program as comments. * A LISTR command would be entered as: * /*! LeftMgn 90 */ * ..AltCmdLead /*! * * Magic incantations to the printer using SetupStrg. * Modify this part to get the desired result on your * printer. These codes work on the NEC P6 (which is * compatible with many dot matrix printers). * [Select 12 cpi printing] ESC 'P' ..SetupStrg 27 'M' [Select 8 lpi printing] ESC '0' ..SetupStrg 27 '0'