home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / utility / crossref / pxl / pxl.doc < prev    next >
Encoding:
Text File  |  1988-05-05  |  45.2 KB  |  1,144 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                       PXL
  23.                           Pascal Cross-Reference Lister
  24.  
  25.                                   Version 1.42
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                                      Programmer: R. N. Wisan, April, 1988
  58.                                     37 Clinton Street, Oneonta, NY, 13820
  59.  
  60.                                                     Not Copyright: Enjoy.
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.                                       Contents
  70.                                       Contents
  71.  
  72.  
  73.  
  74.  
  75.                 1  Introduction  . . . . . . . . . . . . . . . . . 1
  76.  
  77.                 2  The Files . . . . . . . . . . . . . . . . . . . 2
  78.  
  79.                 3  Running PXL . . . . . . . . . . . . . . . . . . 3
  80.  
  81.                    3.1  The Interactive Mode . . . . . . . . . . . 3
  82.  
  83.                    3.2  The Command Line Mode  . . . . . . . . . . 4
  84.  
  85.                    3.3  The Batch Mode . . . . . . . . . . . . . . 5
  86.  
  87.                    3.4  The Cross-Reference  . . . . . . . . . . . 5
  88.  
  89.                    3.5  Include Files  . . . . . . . . . . . . . . 6
  90.  
  91.                    3.6  Page Format  . . . . . . . . . . . . . . . 6
  92.                       3.6.1  Headers                               6
  93.                       3.6.2  Pagination                            9
  94.  
  95.                    3.7  Stopping PXL . . . . . . . . . . . . . . . 9
  96.  
  97.                 4  Adapting PXL  . . . . . . . . . . . . . . . . . 9
  98.  
  99.                    4.1  For Other Pascals  . . . . . . . . . . .  10
  100.  
  101.                    4.2  For Other Printers . . . . . . . . . . .  10
  102.  
  103.                    4.3  PXLINST: Editing Print Control Symbols .  11
  104.                       4.3.1  The Symbols You Need                 11
  105.                       4.3.2  Running PXLINST                      12
  106.                       4.3.3  Wide-Carriage Printers               13
  107.  
  108.                    4.4  Eliminating the Data Files . . . . . . .  13
  109.  
  110.                    4.5  Screen Colors  . . . . . . . . . . . . .  14
  111.  
  112.                 Appendix A:  Using PXL in a Network  . . . . . .  15
  113.  
  114.                 Appendix B:  History . . . . . . . . . . . . . .  16
  115.  
  116.  
  117.  
  118.         PXL 1.42 Pascal X-Ref Lister                               Page 1
  119.  
  120.  
  121.  
  122.  
  123.                                  1  Introduction
  124.                                  1  Introduction
  125.  
  126.  
  127.             Once upon a time, Borland's Turbo Pascal came with an unad-
  128.         vertised source lister called "TLIST."  Unfortunately, it had
  129.         bugs.  This program was written to do some of the things TLIST
  130.         was supposed to do and some things it didn't.  Here are the main
  131.         features:
  132.  
  133.             - It lists a file with headers: by default it puts file name
  134.               (with user's ID) and creation date on page 1, file name and
  135.               page numbers thereafter.  Or, if you prefer, you can make
  136.               your own header of up to five lines.
  137.  
  138.             - If desired, it marks the reserved words by underlining
  139.               them.
  140.  
  141.             - If desired, it numbers the lines and counts begin-end
  142.               pairs.
  143.  
  144.             - It will paginate automatically, but you can insert symbols
  145.               in the file to control page breaks.
  146.  
  147.             - It handles lines of up to 255 characters.  It can use con-
  148.               densed and elite print.
  149.  
  150.             - It will make a cross-reference of the identifiers in the
  151.               source file.
  152.  
  153.             - It will include in the listing (and cross-ref) files called
  154.               with the {$I filename} directive.
  155.  
  156.             - It can be run from a batch file without stopping for inter-
  157.               action.  Should anything go wrong, it sets ERRORLEVEL 1.
  158.  
  159.             - It will feed out a blank page before listing, if requested.
  160.  
  161.             - It will run on DOS 2.00 or later.  If you need to run it on
  162.               an earlier version of DOS, you'll have to use an earlier
  163.               version of PXL.  (1.12 was the last DOS 1.10 version.)
  164.  
  165.         If you leave the reserved words unmarked, of course, PXL will
  166.         list any sort of plain ASCII file.
  167.  
  168.  
  169.  
  170.         PXL 1.42 Pascal X-Ref Lister                               Page 2
  171.  
  172.  
  173.  
  174.  
  175.                                    2  The Files
  176.                                    2  The Files
  177.  
  178.  
  179.  
  180.  
  181.         PXL.DOC is the documentation you are now reading.
  182.  
  183.         PXL.EXE is the working compilation.  You run it from DOS.
  184.  
  185.         PXL.WDS contains the list of reserved words PXL uses if you ask
  186.             it to mark reserved words in the listing.  It must be in the
  187.             default directory or somewhere on the DOS path when you run
  188.             PXL.[1]
  189.  
  190.         PXL.PRN contains the printer control codes which PXL uses when it
  191.             numbers the lines or marks the reserved words.  As it comes,
  192.             it contains the codes for an Epson FX-80, but it may be
  193.             changed by means of PXLINST.  It must be in the default
  194.             directory or somewhere on the DOS path when you run PXL.[1]
  195.  
  196.         PXLINST.EXE is an installation program to put the proper print
  197.             control symbols in PXL.PRN.  You don't need it to run PXL.
  198.             It's only required if you have to adapt PXL for your printer.
  199.  
  200.         PXL.PAS, PXLINIT.PAS, PXLMENU.PAS and PXLLIST.PAS contain the
  201.             source code for PXL.EXE.  You might need it if you have to
  202.             recompile to change colors or as in note [1].
  203.  
  204.         PXLINST.PAS contains the source code for PXLINST.EXE.
  205.  
  206.         PXL.ID and PXL.HDR are not on your disk.  You make them yourself.
  207.             PXL.ID can hold a personal ID if you want one in your header:
  208.             just type your name in the Turbo Pascal editor, and save it
  209.             under "PXL.ID."  When PXL finds such a file, it takes up to
  210.             24 characters from it for an ID.  PXL.HDR can hold your own
  211.             default header to replace PXL's standard one.  See Section
  212.             3.6.1, page 6.
  213.  
  214.  
  215.  
  216.         -----------
  217.  
  218.  
  219.         1. Strictly, PXL can be run without its .WDS and .PRN files.
  220.            Without them it can still number the lines and break up long
  221.            ones, but it can't mark reserved words or count begin-end
  222.            pairs, and it can print only plain pica.  If you ask for any-
  223.            thing it can't do, it will stop and complain.
  224.  
  225.                       __
  226.            But, there is a way of tinkering with the source code in
  227.            PXL.PAS to get it to run properly without the external data
  228.            files.  See "Adapting PXL," esp. page 13 below.
  229.  
  230.  
  231.  
  232.         PXL 1.42 Pascal X-Ref Lister                               Page 3
  233.  
  234.  
  235.  
  236.  
  237.                                   3  Running PXL
  238.                                   3  Running PXL
  239.  
  240.  
  241.  
  242.  
  243.             To run PXL, the two files, PXL.WDS and PXL.PRN must be on the
  244.         default disk or somewhere on your DOS path.  If you want an ID in
  245.         the header, you must make a PXL.ID file and keep it on the path
  246.         or the default disk, too.  There are two ways to run the program:
  247.  
  248.  
  249.         3.1  The Interactive Mode
  250.         3.1  The Interactive Mode
  251.  
  252.  
  253.  
  254.             You can simply enter PXL from the DOS prompt.  It will ask
  255.         what file you want to list.  (It adds the extension .PAS  unless
  256.         you tell it otherwise.)  It will search along the path, and, if
  257.         it finds the file, it will ask you to confirm the file name.
  258.         Then it offers some choices about how you want it printed.  You
  259.         can ask for three characters (upper and lower case both work):
  260.  
  261.         M
  262.         M (Mark) makes it underline the reserved words.
  263.  
  264.         W
  265.         W (Wide) makes it use "condensed print" (if your printer is up to
  266.           it) to handle wide files without breaking up the lines. (In any
  267.           mode, it will break up long lines as necessary and line up the
  268.           continuation flush with the beginning of the original.)
  269.  
  270.         L
  271.         L (Linenumber) makes it number the lines (and use elite type if
  272.           your printer has it, to keep the lines from folding.)  Also, if
  273.           you use any of the above options, it will keep count of begin-
  274.           end pairs and print the number of open Begin (or Repeat or
  275.           Case) statements at each line.
  276.  
  277.         P
  278.         P (Plain)  If you want none of these things, enter a P or just
  279.           put blanks instead of the letters.  Four blanks make it print
  280.           plain.  (Or, just hit <ENTER>)
  281.  
  282.         X
  283.         X (X-Ref) makes it produce a cross-reference of the identifiers
  284.           in your source code.
  285.  
  286.         F
  287.         F (Form-Feed) makes it feed out a blank page before listing.  To
  288.           do this, however, the printer must form-feed on getting the FF
  289.           (char 12) symbol.  Unless it is told (in PXL.PRN) that the
  290.           printer can do this, PXL will neither offer nor accept this
  291.           option.
  292.  
  293.  
  294.  
  295.         PXL 1.42 Pascal X-Ref Lister                               Page 4
  296.  
  297.  
  298.         Used this way PXL, is gabby.  It checks your choices, explains
  299.         your errors, and lets you make corrections.
  300.  
  301.  
  302.         3.2  The Command Line Mode
  303.         3.2  The Command Line Mode
  304.  
  305.  
  306.  
  307.             All this is time-consuming.  To short-cut, enter the informa-
  308.         tion at the DOS prompt.  If you enter
  309.  
  310.            PXL filename
  311.  
  312.         PXL will accept the filename, check to see if it exists, and skip
  313.         its opening inquiries.  For better speed, enter
  314.  
  315.            PXL filename xxxx
  316.  
  317.         (where "xxxx" is any string of characters) it will pick the print
  318.         style letters out of the string, show you what you've asked for
  319.         and ask for confirmation.  If you want a plain vanilla printout
  320.         (no line numbers, key words unmarked), put a "P" in the string.
  321.         Order doesn't matter, you can use upper or lower case, and addi-
  322.         tional stray characters are ignored.  Note:  "P" will override
  323.         anything else (except "X").  Thus, if you enter
  324.  
  325.            PXL XYZ whelp
  326.  
  327.         It will supply the suffix, ".PAS", notice the "p" and ignore the
  328.         other letters.  You'll get file XYZ.PAS, printed plain vanilla.
  329.  
  330.            PXL xyz.pas MeltWax
  331.  
  332.         would get you file XYZ.PAS, with the works: condensed print (W),
  333.         key words underlined (M), line numbers and begin-end counts (L),
  334.         and a cross-reference (X).
  335.  
  336.            PXL XYZ.DOC L
  337.  
  338.         would print file XYZ.DOC with the lines numbered.
  339.  
  340.             When you enter the data at the command line this way, PXL
  341.         will look for your file.  If the file is found, you get one
  342.         screen asking you to confirm the file name and the print mode
  343.         choices.  If you say, "Yes," it goes into its act.  If you say,
  344.         "No" (or if it can't find your file), it reverts to the inter-
  345.         active mode, and you can correct your instructions.
  346.  
  347.             However you start it going, PXL keeps you informed about what
  348.         it's doing.  (Sending lines to printer, Scanning without print-
  349.         ing, Sending X-ref lines to printer, etc.)  It gives you a run-
  350.         ning line-count --to show that something's happening-- and at the
  351.         end of an X-ref printout, you get some statistics about your
  352.         file.
  353.  
  354.  
  355.  
  356.         PXL 1.42 Pascal X-Ref Lister                               Page 5
  357.  
  358.  
  359.  
  360.         3.3  The Batch Mode
  361.         3.3  The Batch Mode
  362.  
  363.  
  364.  
  365.             If you want to run PXL from a batch file, put a line in your
  366.         file just as you'd enter it in the Command Line Mode, but put the
  367.                  BAT
  368.         letters, BAT (upper or lower case) in the instructions.  In that
  369.         case, PXL will not stop for interaction no matter what.  If all
  370.         is well, it will print out as instructed.  If there is any hitch,
  371.         file to print can't be found, .PRN or .WDS file not on the path,
  372.                                <Esc>
  373.         or if somebody presses <Esc> during operation, it will set the
  374.         ERRORLEVEL at 1.  Your batch file can take account of that in
  375.         deciding what to do next.  Here's a sample, which will take the
  376.         file name from the command line, execute PXL, printing the file
  377.         with key words marked and lines numbered, and print "ALL WELL" if
  378.         it's printed the whole file or "ENDED BADLY" if anything went
  379.         wrong:
  380.  
  381.            echo off
  382.            pxl %1 ml bat
  383.            if errorlevel 1 goto Abort
  384.               echo                            ALL WELL
  385.               goto end
  386.            :Abort
  387.               echo                          ENDED BADLY
  388.            :end
  389.  
  390.  
  391.         3.4  The Cross-Reference
  392.         3.4  The Cross-Reference
  393.  
  394.  
  395.  
  396.             The cross-reference cites all the identifiers in your program
  397.         with the line numbers in which they occur.  They are printed with
  398.         the upper/lower case combination of their first occurrence.  At
  399.         the end of the identifier listing, you get a list of all the pro-
  400.         cedures and functions declared in the listing.
  401.  
  402.         I should mention two limitations of the cross-reference:
  403.  
  404.           1.  As far as PXL can tell, an identifier is a given combina-
  405.               tion of symbols.  If you declare a variable like I: integer
  406.               in several different procedures, they'll be lumped together
  407.               in the X-ref listing.  If you care about having an accurate
  408.               list of the declared procedures, be careful not to use a
  409.               procedure name as a local variable earlier in the program.
  410.  
  411.           2.  Standard Pascal allows only numbers to be used as labels.
  412.               Turbo Pascal allows any legal identifier (which must start
  413.               with a letter) as well.  PXL ignores numbers, so it can't
  414.               pick up labels like 99.  If you want your labels listed,
  415.               start them with a letter.
  416.  
  417.  
  418.  
  419.         PXL 1.42 Pascal X-Ref Lister                               Page 6
  420.  
  421.  
  422.  
  423.         3.5  Include Files
  424.         3.5  Include Files
  425.  
  426.  
  427.  
  428.             Files called  with the {$I filename} Include directive, will
  429.         be included in the listing and cross-reference, provided:
  430.  
  431.           1.  The {$I filename} directive begins in the first column of
  432.               the code (if the directive starts anywhere else, PXL will
  433.               simply ignore it), and
  434.  
  435.           2.  PXL can find it.  If the filename specifies a path, say
  436.               {$I B:PXL2.INC}, it will look for the file first in the
  437.               place specified and then search along the path.  Whether it
  438.               finds the file or not, it will print a message on the
  439.               screen and in the printout showing what's happened.
  440.  
  441.         This give you two ways to control inclusion of files in your
  442.         listing.
  443.  
  444.         Note: As it does with the main file, PXL will add the suffix
  445.             "PAS" to the name of include files if none is given.  To in-
  446.             struct it otherwise, put a period at the end of the filename.
  447.  
  448.  
  449.         3.6  Page Format
  450.         3.6  Page Format
  451.  
  452.  
  453.  
  454.             Unless otherwise instructed, PXL will make a one-line header
  455.         of its own devising and paginate automatically every 62 lines
  456.         (including the header).  But, you can instruct it otherwise.
  457.  
  458.  
  459.         3.6.1  Headers
  460.         3.6.1  Headers
  461.  
  462.  
  463.             The standard default header occupies one line.  On the left
  464.         it puts the file name and the user's ID (if it can find a PXL.ID
  465.         file).  On the right of page 1 it puts the file date; subsequent
  466.         pages get the page number instead.
  467.  
  468.             If you prefer a different default header, you can write your
  469.         own.  Keep it in a file called PXL.HDR anywhere on the path, and
  470.         PXL will use it for its default header.  You can still alter the
  471.         header by putting instructions in your text.[2]  Here are the
  472.         rules for header instructions, whether in the text or in PXL.HDR:
  473.         -----------
  474.  
  475.  
  476.         2. There's a heavily commented header file on the disk, under the
  477.            name XXL.HDR. To see what it does, change its name to PXL.HDR
  478.            and run PXL.
  479.  
  480.  
  481.  
  482.         PXL 1.42 Pascal X-Ref Lister                               Page 7
  483.  
  484.  
  485.         A PXL header can have up to five lines.[3]  You can change it at
  486.         any point in the file.  Each header line has three segments which
  487.         must be separately specified.  Each segment specifier has five
  488.         parts:
  489.  
  490.          1. { (opening brace)
  491.  
  492.          2. One of the following symbols:
  493.  
  494.                 .HN    = no header at all
  495.                 .HnL   = left side of Header line #n
  496.                 .HnC   = center of Header line #n
  497.                 .HnR   = right side of Header line #n
  498.                 .HnN   = no Header line number n
  499.                 .HPLnn = print nn pages per line (not really a header in-
  500.                          struction at all, but it can be used in PXL.HDR.
  501.                          See under "Pagination" in p. 9, below.
  502.  
  503.             "n" of course, stands for a numeral.  The other symbols must
  504.             be upper case exactly as shown.
  505.  
  506.          3. a space.  (That's ONE space.  Spaces after the first one
  507.             become part of the text of the header segment.)
  508.  
  509.          4. the text of the header segment.  Within the text, you can use
  510.             the following symbols:
  511.  
  512.                 .Fn = file name
  513.                 .Fd = file date (in long form)
  514.                 .Ft = file time (12-hr am/pm)
  515.                 .Pd = present (or printout) date (mm/dd/yy)
  516.                 .Pt = present (or printout) time (24 hr)
  517.                 .Id = user ID (from PXL.ID)
  518.                  #  = page number (no period)
  519.  
  520.             These symbols are case-sensitive.  They must be upper/lower
  521.             case exactly as shown.
  522.  
  523.          5. } (closing brace)
  524.  
  525.         Some remarks:
  526.  
  527.           + Header instructions can appear anywhere in a line, but each
  528.             one must begin and end on the same line.
  529.  
  530.           + To empty a segment (that's previously been filled), put the
  531.             closing brace right after the symbol and space: {.H2R} means
  532.             empty right segment for 2nd header line.  In general, to emp-
  533.             ty header lines:
  534.         -----------
  535.  
  536.  
  537.         3. This limit is controlled by constant MaxHeader, at the top of
  538.            PXLLIST.PAS.
  539.  
  540.  
  541.  
  542.         PXL 1.42 Pascal X-Ref Lister                               Page 8
  543.  
  544.  
  545.                               ___
  546.                 {.HN} empties all the header lines (i.e., no header).
  547.                 {.H2N} empties the second (#2) header line.
  548.                 {.H2L} empties left segment of the second header line.
  549.  
  550.           + PXL normally puts one blank line above and one blank line
  551.             below the header.  To force extra blanks lines below the
  552.             header, make a blank (not empty) header segment.  {.H5L   }
  553.             would do it --note the extra spaces between L and }.  The
  554.             first space is eaten, the others become the left segment of
  555.             header line 5.
  556.  
  557.           + Normally, header instructions take effect on the next page
  558.             after the instructions.  To specify the opening header, you
  559.                         ___
  560.             have to put all the instructions for it at the top of your
  561.             file.  You can use several consecutive lines to do it, but
  562.             there must be no blank lines between or before them.  At the
  563.             top of the file, you could (almost) specify the standard
  564.             default header thus:
  565.  
  566.                 {.H1L File: .Fn  [.Id]}
  567.                 {.H1R .Ft, .Fd}
  568.  
  569.             Then, there or anywhere in the first page's worth of text:
  570.  
  571.                 {.H1R Page #}
  572.  
  573.                                           ___
  574.           + Note: in PXL 1.41, specifying any header segments at all
  575.             anywhere in the text canceled the default header.  This has
  576.             been changed.  Beginning with PXL 1.42, new header specs
  577.             change only the segments specified.  Thus:
  578.  
  579.               - To cancel the default header for a particular file, you
  580.                 must use {.HN}.  Put that in the first line of the file
  581.                 to head off the default before it gets onto the page.
  582.  
  583.               - If you don't want a default header at all --not ever,
  584.                 create a PXL.HDR file that contains no header instruc-
  585.                 tions.  A zero-byte file will do.  So long as that's on
  586.                 the path, PXL will make no headers on its own.  You can
  587.                 still insert header specs in the body of your file.
  588.  
  589.           + You can differentiate between headers for the first page and
  590.             for subsequent pages.  Within PXL.HDR (and at the top of the
  591.             text), the first specification for a given segment defines
  592.             what's to go on the first page.  A subsequent spec for that
  593.             segment will be used for other pages.  Thereafter, specifica-
  594.             tions simply supersede each other.
  595.  
  596.           + If you need several default headers for different sorts of
  597.             file, you could manage it by controlling the DOS PATH.
  598.  
  599.  
  600.  
  601.         PXL 1.42 Pascal X-Ref Lister                               Page 9
  602.  
  603.  
  604.  
  605.         3.6.2  Pagination
  606.         3.6.2  Pagination
  607.  
  608.  
  609.             To control page breaks, put the following symbols in the
  610.         file:
  611.  
  612.         {.PA}
  613.         {.PA} produces an absolute page advance.  The line on which the
  614.             symbol appears will be the first line of the new page.
  615.  
  616.         {.CPnn}
  617.         {.CPnn} (where nn is a number) makes a conditional page break.
  618.             If there isn't room for nn lines, it will start a new page at
  619.             that point.  Look at the PXL source code.  It's peppered with
  620.             these to keep the procedures whole.
  621.  
  622.             Caution: This command specifies physical lines on the page.
  623.             If you write lines long enough to fold, PXL will not make
  624.             allowance for it and may run out of space on the page and
  625.             split your block across the page break.  If you write such
  626.             lines, be sure to allow for it in specifying the nn.
  627.  
  628.         {.HPLnn} (where nn is a number) specifies the number of lines PXL
  629.             is to print on the page (including the header).  The default
  630.             is 62 lines on a 66 line page.  This command will override
  631.             the standard 4-line bottom margin.[4]
  632.  
  633.             Here, too, a caution: This specifies the number of lines to
  634.             print, not the size of the paper.  Make sure you don't over-
  635.             run the paper by putting too large a number in HPL.  Specify
  636.             actual paper size (in lines) in "Page Control", using PXLINST
  637.             (see p. 11).
  638.  
  639.             Even though it's not a header specification, an HPL instruc-
  640.             tion can be placed in PXL.HDR.
  641.  
  642.  
  643.         3.7  Stopping PXL
  644.         3.7  Stopping PXL
  645.  
  646.  
  647.  
  648.             You can stop PXL at any point by pressing the <Esc> key.  You
  649.         may have to wait while it finishes the line it's working on and
  650.         folds up the files, but don't panic.  It will stop.
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.         -----------
  658.  
  659.  
  660.         4. The default is controlled by variable BottomMargin, set in
  661.            procedure SetUp in PXL.PAS
  662.  
  663.  
  664.  
  665.         PXL 1.42 Pascal X-Ref Lister                              Page 10
  666.  
  667.  
  668.                                  4  Adapting PXL
  669.                                  4  Adapting PXL
  670.  
  671.  
  672.  
  673.  
  674.             As it comes, PXL is designed to print source files from Turbo
  675.         Pascal 4.0 on an Epson FX-80 from an IBM PC.  If that's what you
  676.         want to do, you can use PXL.EXE as it is.  It can be adapted,
  677.         however.
  678.  
  679.             - For other printers, it can be adapted  by changing the
  680.               print control symbols in PXL.PRN.  See the instructions for
  681.               other printers, below, for doing this.
  682.  
  683.             - Other Pascals (including earlier versions of Turbo Pascal
  684.               can also be accommodated by changing the reserved word list
  685.               in PXL.WDS (see below).
  686.  
  687.  
  688.         4.1  For Other Pascals
  689.         4.1  For Other Pascals
  690.  
  691.  
  692.  
  693.             The only Pascal I'm familiar with is Borland's Turbo Pascal.
  694.         If your source code is in plain ASCII text files, the only diffi-
  695.         culty about other Pascals ought to be the list of reserved words.
  696.         (PXL would print the file, but it would mark only words reserved
  697.         in Turbo Pascal 4).
  698.  
  699.             The list of reserved words is in the file PXL.WDS, so all you
  700.         need to do is rewrite the PXL.WDS file to contain your Pascal's
  701.         reserved words.  Any text editor (like the Turbo Pascal editor)
  702.         which makes plain ASCII files will do.  Put one word on each line
  703.         (without any extra blanks).  Order doesn't matter.  Upper/lower
  704.         case doesn't matter.  PXL can handle up to 100 reserved words
  705.         (there are 43 in Turbo Pascal 1.00, 44 in 2.00 and 3.00 and 48 in
  706.         4.00) and the words may be up to 10 characters long.  If you need
  707.         more than that, you'll have to rewrite the source code.  The only
  708.         things you'd have to change are in procedure SetUp at the begin-
  709.         ning of the implementation of PXL.PAS.  They are identified with
  710.         comments.
  711.  
  712.  
  713.         4.2  For Other Printers
  714.         4.2  For Other Printers
  715.  
  716.  
  717.  
  718.             The Epson MX and IBM printers, resemble the FX-80, but with
  719.         the standard PXL.PRN data, the line numbering mode may come out
  720.         odd.  Unless you use the W (condensed print) option, line number-
  721.         ing expects an elite font, which these printers lack. If you
  722.         write lines long enough to fold, you should use PXLINST to change
  723.         the print control symbols in PXL.PRN.
  724.  
  725.  
  726.  
  727.         PXL 1.42 Pascal X-Ref Lister                              Page 11
  728.  
  729.  
  730.             For other printers, consult your printer manual to see what
  731.         you need.  Again, use PXLINST to install the proper data.
  732.  
  733.  
  734.         4.3  PXLINST: Editing Print Control Symbols
  735.         4.3  PXLINST: Editing Print Control Symbols
  736.  
  737.  
  738.  
  739.             To change the print control symbols, you must first work out
  740.         what symbols you'll need.  Then, with PXL.PRN on the default
  741.         drive, run PXLINST.
  742.  
  743.  
  744.         4.3.1  The Symbols You Need
  745.         4.3.1  The Symbols You Need
  746.  
  747.  
  748.  
  749.             PXL assumes that your printer can be made to underline and to
  750.         compress its type to 12-character-per-inch "elite" and 17-charac-
  751.         ter-per-inch "condensed" by sending it control codes of 1 to 3
  752.         characters.  These characters must be in PXL.PRN, on the default
  753.         drive when you run PXL.  Seven print control strings are re-
  754.         quired, start and stop for three type styles plus page control
  755.         instructions:
  756.  
  757.         ____________
  758.         Underlining.  If you prefer to mark your reserved words in some
  759.             other way (boldface? italics?), put here whatever your
  760.             printer needs for it.
  761.  
  762.         _____
  763.         Elite (12 characters per inch) type.  Normally, when PXL uses the
  764.             symbols you put here, it assumes it will get 96 characters
  765.             per line.  Normally, it uses this font only when numbering
  766.             the lines.
  767.  
  768.             If your printer hasn't got an "elite" font (e.g., the IBM
  769.             printer), you have a choice.  If you put the symbols for
  770.             "condensed" in both places, it will always use "condensed"
  771.             for line numbering (it will adjust the line lengths prop-
  772.             erly).  What I recommend is to put nothing in PXL.PRN for
  773.             "elite."  Then, PXL's "L" command will number the lines in
  774.             plain pica, and "WL" (wide, line-numbering) will number them
  775.             using "condensed."
  776.  
  777.         _________
  778.         Condensed (17 characters per inch) typeface.  This is the font
  779.             invoked by the "W" (for "wide") symbol.  If your printer
  780.             hasn't got a "Condensed" font, put nothing here.  In that
  781.             case, if you have something for "Elite," PXL will use elite
  782.             for both elite and condensed, lines cut to fit 96 characters
  783.             per line.  If you put nothing for "Elite" and nothing for
  784.             "Condensed," everything will come out in pica at 80 charac-
  785.             ters per line.
  786.  
  787.         ____________
  788.         Page Control.  Here, it needs to be told whether your printer
  789.             will feed out a new page when sent a Char #12 ("FF") and, if
  790.  
  791.  
  792.  
  793.         PXL 1.42 Pascal X-Ref Lister                              Page 12
  794.  
  795.  
  796.             not, how many lines it puts on a page.  If you give it a 12
  797.             for "Page control," it will use Char #12 to form-feed.  If
  798.             you give it any other number, it will take that for the num-
  799.             ber of lines the printer gets to a page.
  800.  
  801.             Look up the print control symbols in your printer manual.
  802.         Work out the ASCII numbers for them.  PXLINST requires the num-
  803.         bers; it can't accept characters.  Thus, to enter "Escape G", you
  804.         would use the numbers, 27, 71.  27 is the ASCII number for "Es-
  805.         cape", and 71 is the number for "G". When you know what numbers
  806.         you're going to need, put PXL.PRN on the default drive, and run
  807.         PXLINST.
  808.  
  809.  
  810.         4.3.2  Running PXLINST
  811.         4.3.2  Running PXLINST
  812.  
  813.  
  814.  
  815.             Since it's an .EXE file, PXLINST, like PXL runs straight from
  816.         DOS.  When you run it, PXLINST gives you a screen showing the
  817.         seven different instructions.  If it finds PXL.PRN somewhere on
  818.         your DOS path, it will show you what is currently in the file for
  819.         each instruction and the "Present Data" you've set for them.  It
  820.         gives pretty good operating instructions.
  821.  
  822.             - Move the cursor to the line you want to change.
  823.  
  824.                                                     NUMBERS
  825.             - Enter the proper sequence of numbers (NUMBERS, not charac-
  826.               ters), separating them with commas.  Press <Enter>, and it
  827.               will move on to the next instructions.  You can use up to
  828.               three ASCII numbers per instruction.
  829.  
  830.             - If you want nothing for a given instruction, press <Enter>
  831.               alone.[5]
  832.  
  833.             - Make sure the "Present Data" display indicates what you
  834.               wanted.
  835.  
  836.             - When the "Present Data" is what you want, press <Esc> to
  837.               end the program.  It will then ask whether you want the
  838.               file rewritten with your new data.  Up to this point,
  839.               PXLINST hasn't actually changed the file.  If you've made a
  840.               mess, you can say "No."
  841.  
  842.             If you happen to run PXLINST without PXL.PRN somewhere on the
  843.         path, no matter.  It won't have any file data to show you, and it
  844.         will start you out with "Present Data" of "[nothing]," but you
  845.         -----------
  846.  
  847.  
  848.         5. If your printer has none of these print options, enter nothing
  849.            for everything but "Page Control."  PXL will then print plain
  850.            vanilla, but it will break the lines appropriately, number
  851.            them, give you begin/end counts, and make cross-references.
  852.  
  853.  
  854.  
  855.         PXL 1.42 Pascal X-Ref Lister                              Page 13
  856.  
  857.  
  858.         can enter the numbers you want, and PXLINST will create a new
  859.         PXL.PRN file on the default disk.
  860.  
  861.  
  862.         4.3.3  Wide-Carriage Printers
  863.         4.3.3  Wide-Carriage Printers
  864.  
  865.  
  866.  
  867.             PXL is designed to run on a narrow-carriage printer, using
  868.         8.5 inch wide paper.  If you have a wide printer which puts 133
  869.         pica characters on a line, you can make use of the full width by
  870.         giving PXL deceitful printer data.  The trick turns on the fact
  871.         that "condensed" print on a narrow printer is designed to print
  872.         133 columns per line to handle printouts meant for a wide
  873.         printer.  So, when PXL thinks it's using "condensed" print, it
  874.         makes wide lines.
  875.  
  876.             Run PXLINST, and, where it calls for "condensed" instruction
  877.         symbols, put the instructions for plain pica.  Give "pica start"
  878.         instructions for both "condensed start" and "condensed stop".
  879.         The W (wide) option, will now print wide lines in pica.
  880.  
  881.             The L (line numbering) option (without a W) will still use
  882.         elite and break lines at 84 columns of program text.  If entering
  883.         LW bores you and you want the L option in full width, give pica
  884.         instructions for both "elite" and "condensed."  PXL will now
  885.         think it has "condensed" for both of these and adjust its width
  886.         accordingly.
  887.  
  888.  
  889.         4.4  Eliminating the Data Files
  890.         4.4  Eliminating the Data Files
  891.  
  892.  
  893.  
  894.             PXL can be made to run without the .PRN and .WDS data files
  895.         by a simple alteration in PXL.PAS.  The program already contains
  896.         the necessary code for loading the print instructions and re-
  897.         served word list internally.
  898.  
  899.             All that's required is to set the value of DataFiles to False
  900.         instead of True.  (You do this in procedure SetUp in PXL.PAS.
  901.         The comments there will show you what's what.)  Of course, that
  902.         will commit you to the TP4/Epson data that's in the code.  If you
  903.                        ____
  904.         want to change that, you must go deeper
  905.  
  906.             - Procedure LoadReserv in PXLMENU.PAS contains a list of key
  907.               words in Turbo Pascal 4.00
  908.  
  909.             - Procedure GetPrinterData in PXLINIT.PAS has the print con-
  910.               trol symbols.  Be careful to preserve the data form.  (Es-
  911.               sentially, it's the form of a Turbo Pascal string[3].)
  912.               Each instruction takes four bytes.  The first (subscript 0)
  913.               contains the number of following bytes which are signif-
  914.  
  915.  
  916.  
  917.         PXL 1.42 Pascal X-Ref Lister                              Page 14
  918.  
  919.  
  920.               icant in the instruction.  Set unused bytes to $FF.  This
  921.               is exactly how the data would come in from PXL.PRN.
  922.  
  923.               I suggest you begin by using PXL with the external files,
  924.               because it's easier to experiment on printer data with
  925.               PXLINST than by changing and re-compiling PXL.  When you
  926.               know what numbers you need, you can make the necessary
  927.               changes to GetPrinterData in PXLINIT.PAS, set DataFiles to
  928.               false in PXL.PAS, and re-compile.
  929.  
  930.         If you set out to make this adaptation, it would be wise to make
  931.         a copy of PXL first and experiment on the copy.
  932.  
  933.  
  934.         4.5  Screen Colors
  935.         4.5  Screen Colors
  936.  
  937.  
  938.             On a monochrome text monitor, PXL always runs in black and
  939.         white.  On other monitors it normally uses color, and three vari-
  940.         ables: NormalColor, FrameColor, and Background control the
  941.         colors.  FrameColor is used only for the ornamental rectangle.
  942.         Everything else is in NormalColor.  To set the colors to your
  943.         liking, change the values in procedure SetUp in PXL.PAS.
  944.  
  945.  
  946.  
  947.             I hope you enjoy PXL and find it useful.  If you find bugs in
  948.         it or make any improvements, do, please, send me word.
  949.  
  950.                                      Programmer: R. N. Wisan, April, 1988
  951.                                     37 Clinton Street, Oneonta, NY, 13820
  952.  
  953.  
  954.  
  955.         PXL 1.42 Pascal X-Ref Lister                              Page 15
  956.  
  957.  
  958.  
  959.  
  960.                        Appendix A:  Using PXL in a Network
  961.                        Appendix A:  Using PXL in a Network
  962.  
  963.  
  964.             The batch mode (BAT) and form-feed (F) options were added in
  965.         order to make  PXL usable conveniently on a printer-sharing net-
  966.         work.  To illustrate this use of PXL, this appendix describes the
  967.         use made of it with elementary classes in the PC Lab at Hartwick
  968.         College in Oneonta, NY.  The network was the University of
  969.         Waterloo's JANET.
  970.  
  971.             In this system, all utilities were kept on a virtual disk in
  972.         "Drive A."  Students kept their own programs on a real disk drive
  973.         labelled D: by the network, and they kept a PXL.ID user ID file
  974.         on their disks.  They were taught to send printer output from
  975.         their programs to a file, D:OUT.PUT.  To allow these beginning
  976.         students to get their printouts with a minimum of confusion and a
  977.         minimum of instruction, PXL was run from a batch file.  To get
  978.         printouts, they merely entered:
  979.  
  980.             A:NEWPRINT programfilename
  981.  
  982.         Here is an annotated copy of NEWPRINT.BAT:
  983.  
  984.         ECHO OFF
  985.         A:PXL D:%1 MLXF BAT  REM List program marked, numbered, xref, and FF
  986.                              REM (to avoid the network's printout header)
  987.         IF ERRORLEVEL 1 GOTO ABORT   REM Check that program listing went well
  988.           A:PXL D:OUT.PUT BAT        REM List output file plain w/o FF
  989.           IF ERRORLEVEL 1 GOTO ABORT REM Check that this went well
  990.              A:PRINTIT          REM All went well, so send to printer,
  991.                                                 REM and report success:
  992.              ECHO D:%1 and OUT.PUT sent to printer
  993.         GOTO END
  994.         :ABORT                       REM If all did not go well,
  995.            A:PURGE *                 REM Abort printing,
  996.                                      REM and report failure:
  997.            ECHO Error in listing.  Printout has been aborted.
  998.         :END
  999.  
  1000.         Note: PRINTIT is the network's print command.  PURGE * cancels
  1001.               everything sent to the print spool from this work station.
  1002.  
  1003.  
  1004.  
  1005.         PXL 1.42 Pascal X-Ref Lister                              Page 16
  1006.  
  1007.  
  1008.  
  1009.  
  1010.                                Appendix B:  History
  1011.                                Appendix B:  History
  1012.  
  1013.  
  1014.  
  1015.  
  1016.             In olden times, Turbo Pascal version 1.0 came with a source
  1017.         lister called TLIST.  Unfortunately, it was buggy.  Borland ex-
  1018.         plained that TLIST was an unadvertised freebie and wouldn't work
  1019.         on all printers.[6]  Mainly as an exercise, I wrote ELIST to do
  1020.         on my Epson (FX-80) some of the things TLIST was supposed to do.
  1021.         Some versions of it were circulated in July, 1984.
  1022.  
  1023.             In August of 1984, ELIST was revised to allow use of other
  1024.         printers and other Pascals by putting printer control symbols and
  1025.         reserved words in separate data files.  An awkward installation
  1026.         program was supplied to edit the printer data.  In honor of that,
  1027.         I renamed it "NELIST" (pronounce "N" and "E" separately).  Early
  1028.         versions worked only in the interactive mode.  Later versions
  1029.         added a command line mode to skip (most of) the interactive gab.
  1030.  
  1031.  
  1032.         NELIST Version 2.0, April, 1985, was improved:
  1033.  
  1034.           1.  Handles wide files (up to 255 characters):
  1035.  
  1036.                   - Breaks long lines neatly to prevent folding.
  1037.  
  1038.                   - Condensed print ("W") option added for wide files.
  1039.  
  1040.           2.  File header contains file's creation date instead of
  1041.               printout date.
  1042.  
  1043.           3.  Include files {$I filename} incorporated in the listing.
  1044.  
  1045.           4.  Interactive messages streamlined a little, especially for
  1046.               the command line mode.
  1047.  
  1048.  
  1049.         PXL Version 1.00, June, 1985:
  1050.  
  1051.             In the spring of 1985, when our Computer Science program (at
  1052.         Hartwick College) was overhauled, Turbo Pascal 3 was adopted as
  1053.         the beginning language, to be run on an IBM PC equipped network.
  1054.         For that installation, NELIST 2 seemed a useful accessory, but a
  1055.         -----------
  1056.  
  1057.  
  1058.                         _________
  1059.         6. According to TUG Lines Vol. I, No. 3, p. 1, Borland will prob-
  1060.            ably never fix the bugs in TLIST.  Apparently, it was written
  1061.            as an in-house utility, and providing it to the customers "was
  1062.            entirely an afterthought.  One day the source code for TLIST
  1063.            was accidentally deleted..."
  1064.  
  1065.  
  1066.  
  1067.         PXL 1.42 Pascal X-Ref Lister                              Page 17
  1068.  
  1069.  
  1070.         cross-reference function was desired.  PXL is the result.  It is
  1071.         built on the old NELIST foundation, with the following changes:
  1072.  
  1073.           1.  The cross-reference (X) feature is, of course, the most
  1074.               important addition.
  1075.  
  1076.           2.  The options have been simplified.  The user now gets no
  1077.               choice about the manner of marking reserved words.  If you
  1078.               want to boldface instead of underlining them, you must
  1079.               change PXL.PRN.
  1080.  
  1081.           3.  Changing PXL.PRN is now much easier.  Installation program
  1082.               (now called PXLINST) rebuilt with full-screen data entry.
  1083.  
  1084.           4.  The ability to run without external .PRN and .WDS files has
  1085.               been built into the program.  If constant DataFiles is set
  1086.               to False, PXL will use built-in data.
  1087.  
  1088.           5.  While the program is running, a line count is displayed.
  1089.               The point of this is to assure user that the computer has
  1090.               not died.  At the end of an X-ref listing, various statis-
  1091.               tics about the program are given.
  1092.  
  1093.  
  1094.         PXL Version 1.10, July, 1985:
  1095.  
  1096.             Better documentation in PXL2.INC, smoother interactive mode,
  1097.         and:
  1098.  
  1099.           1.  PXL now understands hex numbers.
  1100.  
  1101.           2.  Programs containing exactly one procedure or function will
  1102.               now cross-ref properly.
  1103.  
  1104.           3.  For the sake of consistency, the former PXLID.DAT (the per-
  1105.               sonal ID file) has been renamed, PXL.ID.
  1106.  
  1107.           4.  You can now STOP the program at any point by pressing the
  1108.               <Esc> key.  (Control-Break doesn't work.)
  1109.  
  1110.           5.  PXL will now handle file names which have no extension.
  1111.  
  1112.  
  1113.         PXL Version 1.11, October, 1985
  1114.  
  1115.           1.  The main addition is the ability to run from batch files.
  1116.               In the batch mode it avoids interactive pauses and sets
  1117.               ERRORLEVEL 1 if anything goes wrong.
  1118.  
  1119.           2.  File name entered without a drive letter will be shown with
  1120.               the default drive letter.
  1121.  
  1122.  
  1123.  
  1124.         PXL 1.42 Pascal X-Ref Lister                              Page 18
  1125.  
  1126.  
  1127.           3.  Better control over include files.  Like TLIST, PXL will
  1128.               incorporate include files only if the {$I filename} command
  1129.               begins in the first column.
  1130.  
  1131.           4.  Manual includes better treatment of the problems of adap-
  1132.               ting PXL to other machines and operating systems.
  1133.  
  1134.  
  1135.         PXL Version 1.12, February, 1986
  1136.  
  1137.           1.  F (Form-Feed) option added to allow operation under a
  1138.               network which puts its own header on printouts.  The F
  1139.               option clears the network's header off the page.
  1140.  
  1141.           2.  PXL 1.11 could not safely be used in the batch mode under
  1142.               DOS 1.10 because any hitch would hang the machine.  Proce-
  1143.               dure SetErrorLevel now checks for DOS version, so batch
  1144.               mode is now safe under any DOS version.
  1145.  
  1146.  
  1147.         PXL Version 1.20, June, 1986
  1148.  
  1149.             PXL now searches along the whole DOS path both for the file
  1150.         it's to process and for its own auxiliary files.  This requires
  1151.         the newer DOS 2 file handling procedures, and the problem of DOS
  1152.         compatibility is evaded by abandoning DOS 1.10 entirely.
  1153.  
  1154.  
  1155.         PXL Version 1.21, September, 1986
  1156.  
  1157.             PXL is now savvy about screen colors.  Constants added to set
  1158.         colors to taste.  Further, PXL is polite: on exit, it returns the
  1159.         screen to the color it found there.
  1160.  
  1161.  
  1162.         PXL Version 1.22, November 15, 1986
  1163.  
  1164.             Small bug about Xref printout corrected.  Background added to
  1165.         screen color constants.
  1166.  
  1167.  
  1168.         PXL Version 1.23, November 22, 1986
  1169.  
  1170.             Bug corrected: PXL no longer hangs the machine on (a) no
  1171.         path, (b) a path which contains no semi-colon, or (c) a blank
  1172.         command-line entry.
  1173.  
  1174.  
  1175.         PXL Version 1.4X January, 1988
  1176.  
  1177.             The X means "experimental."  Rewritten in and for Turbo
  1178.         Pascal 4.00.  Provision made for Turbo 4's 8 layers of include
  1179.         files.  Asterisks at right of page indicate depth of inclusion.
  1180.  
  1181.  
  1182.  
  1183.         PXL 1.42 Pascal X-Ref Lister                              Page 19
  1184.  
  1185.  
  1186.             Instead of constants to switch colors & such, you must jigger
  1187.         procedure SetUp in PXL.PAS.
  1188.  
  1189.  
  1190.         PXL Version 1.41 February, 1988
  1191.  
  1192.             Some cleansy-upsy in source code.  The menu is still a hor-
  1193.         rible hack, but less horrible.  Generally, a less hasty response
  1194.         to TP4 than 1.4X was.
  1195.  
  1196.             New feature: User can override the default header and specify
  1197.         a header of up to five lines.
  1198.  
  1199.  
  1200.         PXL Version 1.42 April, 1988
  1201.  
  1202.             Improvement in header specification.  Version 1.41's in-text
  1203.         specification methods are still available, but now you can write
  1204.                 _______
  1205.         you own default header to replace PXL's by keeping what you want
  1206.         in PXL.HDR, anywhere on the path.
  1207.  
  1208.             One difference: in 1.41, any header specification in the text
  1209.         would cancel the entire default header.  Now, header instructions
  1210.         in the text replace only the segments specified.  To wipe out the
  1211.         default header, you must do so explicitly.
  1212.