home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / MPRINFIL.ZIP / PRINTPAS.DOC < prev    next >
Encoding:
Text File  |  1990-06-07  |  9.7 KB  |  190 lines

  1.             TURBO PASCAL MODULATING PRINTING UTILITY
  2.  
  3. The Turbo Pascal Printing Utility is designed to improve the readability
  4. and usefulness of printed Turbo Pascal (TP) source code. This is done
  5. by utilizing the printing commands available on most dot matrix printers
  6. commonly used with PC's. The source code file is not affected in any way,
  7. although an additional file may be created, stripped of comments, if you
  8. choose. The program may be run from a command line or you may be prompted
  9. by the program. Printing output is through the lpt1 parallel port.
  10. To properly use this printing filter (TPMPU), a few guidelines must be fol-
  11. lowed in writing source code. These guidelines will be highlighted as the
  12. operation of TPMPU is outlined below. TPMPU assumes normal pascal syntax.
  13.  
  14. Using the Command Line Input With Switches ("/"):
  15. After typing TPMPU's filename, you may list the filename to be processed
  16. with any necessary path preceeding it in dos format. If the filename excludes
  17. a period and extension, ".pas" will be assumed. Other parameters may be
  18. added as desired, separated by spaces (or tabs). To change a later parameter,
  19. the earlier ones must be listed. The parameter order is:
  20.               a)path with filename
  21.               b)printer number (default to Epson FX)
  22.               c)create comment stripped file  (default is no creation)
  23.               d)modify global var before main program  (default is yes)
  24.  
  25. Set your printer to "top of form" before starting TPMPU.
  26.  
  27. Example: prntpas  /b:\pascal\testprog  /3
  28. TPMPU's executable filename is prntpas, it is located on drive "b" in sub-
  29. directory "pascal\". The program to print is testprog (.pas) and is to be
  30. printed with printer type #3. No comment stripped file is created and global
  31. variables are modified throughtout the source code.
  32.  
  33. Using Prompt Input:
  34. To become familiar with TPMPU, just type its filename, it will ask you
  35. for inputs, displaying values to be used on the command line when desired.
  36. Set your printer to "top of form" before entering printer type.
  37. If TPMPU can't find source code file, you will be reprompted for input.
  38.  
  39. TPMPU Operation:
  40. After getting preliminary information from the user, through a command line
  41. or by prompting, the pascal source code file is retrieved and the printer is
  42. initialized. Printing is started with a heading of the current date/time.Then
  43. the filename is printed with its directory listing of date/time.
  44. The key word "PROGRAM" or "UNIT" (all upper case) is searched for in the
  45. first 50 lines of text. If found, the phrase after it will be printed with
  46. emphasis. If the program is a pascal unit, then you will be prompted for
  47. whether You want to mark all procedures/functions or just external ones.
  48. TPMPU next starts processing the code for procedure and function
  49. names, until the body of the main program begins. The comment {main program}
  50. or {MAIN PROGRAM} should be written at the "begin" of the main program. If
  51. the source code is a pascal unit, then place this comment on the line with
  52. "implementation".
  53. Note there is only one space between the comment brackets and that is between
  54. the two words.
  55.  
  56.     ***********INCLUDE "{MAIN PROGRAM}" or "{main program}" at***********
  57.             *********BEGIN of the MAIN PROGRAM BODY************
  58.          ********or if a PASCAL UNIT, at "IMPLEMENTATION"*********
  59.  
  60. All procedure/function declarations must start with the upper case word
  61. "PROCEDURE" or "FUNCTION".
  62.  
  63.    *********USE "PROCEDURE" or "FUNCTION" in DECLARING THEM**********
  64.  
  65. After collecting these identifiers, the program starts from the begin-
  66. ning to print the source code, emphasizing+underlining the procedure/
  67. function names. The index number of the name will be printed as a com-
  68. ment on the right edge.It also looks for variables local to these pro-
  69. cedures/functions. The printing of these variables are modulated (us-
  70. ually italics) in the body of the procedure/function they exist in.
  71. In the declaration of them, there must be the word "var" or "Var" on
  72. a separate line (comments excepted) before any local variables are listed.
  73.  
  74.     ********DECLARE LOCAL VARIABLES WITH "Var" or "var" on a***********
  75.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  76.  
  77. Global variables must be declared with the word "VAR" on a separate line
  78. (comments excepted) before any variables are listed.
  79.  
  80.         ********DECLARE GLOBAL VARIABLES WITH "VAR" on a***********
  81.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  82.  
  83. Global variables will be printed in double strike form in the main program.
  84. If you choose, they will not be highlighted in the procedures and functions
  85. (the default is to highlight them throughout the source code).
  86.  
  87. TPMPU will keep a tally of "begin" and "end" on the right margin, looking
  88. for the words "begin", "Begin", "BEGIN", "end", "End", and "END". By tallying
  89. with "begins" adding and "ends" substracting from an index, you can more
  90. easily decipher the compound sentence logic in your code. All procedures/
  91. functions should begin/end with an index of one.
  92.  
  93.        ********USE LOWER ONLY, UPPER ONLY, or FIRST LETTER ONLY********
  94.               *******UPPER CASE for "BEGIN" and "END"********
  95.  
  96. Special case on tallying begins and ends:
  97. A few TP words have implicit "begin" and an explicit "end". Tallying is
  98. done as if both were explicit. When using the "case of" statement, both
  99. these words must be written on the same line for TPMPU to sense an implicit
  100. "begin".
  101.            *******"Case of" must appear on the same line********
  102.  
  103. After printing the source code, TPMPU will print a listing of procedures
  104. and functions detected in source code with index numbers. If the code
  105. is written with only uppercase "procedure" and "function" in declar-
  106. ations, then you can use the find-string feature of TP and the index numbers
  107. of this listing to easily move about your code while working in TP editor.
  108.  
  109. TPMPU will compress printing of comments, of type "{ }" and "(* *)".  The
  110. former will be printed at 12 or 15 cpi if your printer supports this (other-
  111. wise it will be printed at 17 cpi). The latter will be printed at 17 cpi.
  112. You may request that a source code disk file be created of your code strip-
  113. ped of one or both of these code forms. Using "(* *)" for your skipped code
  114. and "{ }" for programmer comments will enable you to conveniently strip off
  115. one and retain the other. If you have special 'in-house' comments, they
  116. may be enclosed in "(* *)" and stripped off with the code before the
  117. code is 'released'.
  118.  
  119. To clarify TPMPU's operation, a short "nonsense" pascal program is included
  120. to print using TPMPU.
  121.  
  122. Errors:
  123. a) If more procedures & functions are detected than can be listed, a
  124. comment will be displayed. You will be prompted to print the code anyway
  125. or quit.
  126. b) If there seems to be an error in the "begin-end" count, this will be
  127. displayed. Typically this happens when a procedure/function does not start
  128. with a count of 1.
  129.   NOTE:In processing pascal units, because "implementation" has an
  130.   implicit "begin", procedure/functions will start with a count of 2.
  131.   To avoid erroneous error comments, you can write "implementation" to
  132.   avoid detection (ex. implementatioN, ImplementatioN).
  133.  
  134. Registration:
  135.  
  136. You are free to use TPMPU for up to a month before you should register.
  137. You are free to make copies and distribute it in combination with accompanying
  138. documentation.
  139.  
  140. The cost is $15 plus $1 for shipping.
  141.  
  142. By registering, you will receive:
  143.  
  144. a) The current updated version of TPMPU plus information on constructing
  145. your personalized printer command files for use by TPMPU. To help you
  146. work out command files for your printer, to produce personally tailored
  147. printing results, a test program (with source code) will be included.
  148. For convenience, you may request the default printer type be other than
  149. Epson FX.
  150.  
  151. b) For the registered program, the max # of procedures and functions that
  152. may be detected is = 80. (The unregistered program is 20.) If desired, you
  153. may request another max value.
  154.  
  155. c) A second updated version will have a default to printer type "8", for
  156. use with an external CMD file.
  157.  
  158. d) Both updated, registered versions of TPMPU will include the  provision to
  159. divert the modulated printing text to a disk file. Diverting the printing
  160. text will greatly speed up the program's operation and enable you to use
  161. "print.com" in DOS, a crude but functional 'time-share' utility. As you
  162. probably know by now, printing a long text file on a dot matrix printer can
  163. take a while. Since the running time for TPMPU is limited by how fast your
  164. printer can print output, putting the output to a disk file makes TPMPU
  165. run much faster. By using "print" in DOS, you can get your printed output
  166. of modulated source code while doing other work on your PC.
  167.  
  168. e) Registered versions of TPMPU include a provision to print out only
  169. the procedure/function table with indices. I often use this table to
  170. maneuver around a large source code program with the help of "search" in
  171. the TP editor.
  172.  
  173. f) As a registered owner you also have the privilege of receiving program
  174. support. I can be reached at the address below or if you are connected
  175. to the "WELL" (a San Francisco bay area 'lectronic computer network),
  176. my user i.d. is "dld" (use lower case). The phone number for the WELL
  177. is (415)-332-6106.
  178.  
  179. g) As a registered owner, you may request modifications to TPMPU to meet
  180. special needs and styles. The cost for such modifications naturally depends
  181. on how much reworking is necessary. In replying to such requests, I will
  182. state the cost and time estimate for doing the modifications.
  183.  
  184. My address for registration and support is:
  185.  
  186.                  Dennis DiBart
  187.                  747 Elm St.
  188.                  El Cerrito, Ca. 94530
  189.  
  190.