home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / LISTER57.ZIP / LISTER.DOC < prev    next >
Encoding:
Text File  |  1989-11-12  |  6.3 KB  |  133 lines

  1.      The  Lister program was written in Turbo Pascal to print out
  2. pascal  programs.   It has grown into a rather large and  complex 
  3. program doing many more things than I had originally  invisioned.  
  4. Among  the variety of things which this program does is the orig
  5. inal  which is to print out a pascal program in a condensed  for
  6. mat.   This  means  that up to 75 lines per page are put  on  the 
  7. paper.   A page feed can be forced by the .PA command which word
  8. star  uses.   Remember however that in pascal source  code  these 
  9. must be commented out( "{.PA}" for example ).
  10.  
  11.      Part  of the appeal of the Turbo Pascal package is that  the 
  12. modules can remain small, and still produce a very large program.  
  13. It  is this ability to "Include" files into larger programs which 
  14. required the listing program to do the same thing.   To help  the 
  15. programmer,  the  listing  program separates the modules using  a 
  16. dual  line  number  scheme  which  numbers  the  entire   program 
  17. continuously  and  also numbers each included  module.   You  can 
  18. always  find  out what line a change is needed because  the  line 
  19. number within the module is listed correctly.
  20.  
  21.      Anothe≥  probleφ fo≥ pasca∞ programmer≤ i≤ thσ  locatioε  oµ ì
  22. thσá  call≤á t∩á  procedure≤ anΣ function≤ á whicΦá cros≤á pagσ ì
  23. boundrie≤ oµ thσ listing«á  Wσ jus⌠ can'⌠ seeφ t∩ finΣ thσ referì
  24. enceΣá modulσá oµ  code«á   T∩ hel≡ this¼á  thσá listinτá prograφ ì
  25. insert≤á  int∩  thσ listing¼á  thσ  cross-referencσ  pagσá numbe≥ ì
  26. wherσá thσ  referenceΣ  procedurσ o≥ functioε  caε bσá located«  ì
  27. Iεá addition¼á thσ las⌠ pagσ oµ  thσ listinτ i≤ ß cros≤ inde°á oµ ì
  28. eacΦá á functioε  o≥  procedurσ ¼á wherσ  i⌠  caε bσ founΣá anΣ ì
  29. eacΦ linσ numbe≥ iε thσ maiε  prograφ wherσ thσ  procedurσ o≥á  ì
  30.  functioε  i≤ calledíá  Thi≤ i≤ donσ activel∙ a⌠  lis⌠  timσ s∩ ì
  31. tha⌠á an∙ prograφ  changes(re-arrangements⌐  arσ correctl∙ referì
  32. enced.
  33.  
  34. .pa
  35. è     To complete the first stage of the program,  a very friendly 
  36. menu was developed to interact with the user.  
  37.  
  38.      To use this program Type "LISTER56 program.ext"  or
  39.                               "LISTER56"
  40.  
  41.      When the program name is included,  the command line is used 
  42. to fill in the information into the program to be listed variable 
  43. and the menu asks whether you want to Edit,  Print, Directory, or 
  44. Quit.
  45.  
  46.      If the program name is not included,  the same menu appears, 
  47. however  you  are  defaulted into the edit option  to  enter  the 
  48. required file to list.
  49.  
  50.      Answer  most questions with a "Y" or "N" key press  and  the 
  51. cursor will advance to the next question.  Numbers require that a 
  52. number be entered.   An Up or Down arrow key will move the cursor 
  53. in the proper direction.   The return key will accept the default 
  54. answer just as a down arrow does.  With this system, the user can 
  55. wander  up and down the input screen changing anything he  wants, 
  56. during the editing phase.
  57.  
  58.      During  the printing process,  the printing can be suspended 
  59. at anytime by pressing any key on the keyboard.  The printing can 
  60. be continued or aborted from that location with another  keypress 
  61. as  directed  by  the  screen.   This can  be  most  useful  when
  62. answering the telephone.
  63. .pa
  64. è     Thσá prograφá wa≤ enhanceΣ b∙ addinτ aεá automatiπá indexinτ ì
  65. featurσá whicΦ wil∞ cros≤ referencσ eacΦ anΣ ever∙ variablσá useΣ ì
  66. iεá thσá program«á  Thσá lis⌠ i≤á accumulateΣá alphabeticall∙á b∙ ì
  67. variablσá namσ theε b∙ loca∞ procedurσ namσ anΣ finall∙ globally«  ì
  68. Thi≤á featurσ i≤ defaulteΣ off¼á anΣ mus⌠ bσ turneΣ oε b∙ ßá men⌡ ì
  69. selection«  Thi≤ speed≤ u≡ thσ printou⌠ proces≤ anΣ doesn'⌠ wastσ ì
  70. all of that paper until the final version is to be printed.
  71.  
  72. The structure of the program is shown in the following example
  73.  
  74.         32      |+--   begin
  75.         33      ||     assign (F1,filespec);
  76.         34      ||     reset (F1);
  77.         35      ||     count := 1;
  78.         36      ||     diskspace := 0.0;
  79.         37      ||     str(count,str2);
  80.         38      ||     assign (F2,'a:Output'+str2+'.dat');
  81.         39      ||     rewrite (F2);
  82.         40      ||+--  repeat
  83.         41      |||        if diskspace > 300000.0 then
  84.         42      |||+--         begin
  85.         43      ||||           close (F2);
  86.         44      ||||           write (^G,' please insert another blank formatted diskette and press "RETURN" ');
  87.         45      ||||+--        repeat
  88.         46      |||||              ch := ^@;
  89.         47      |||||              if keypressed then
  90.         48      |||||                  read (kbd,ch);
  91.         49      ||||+--            until ch = ^M;
  92.         50      ||||           count := count + 1;
  93.         51      ||||           str(count,str2);
  94.         52      ||||           assign (F2,'a:Output'+str2+'.dat');
  95.         53      ||||           rewrite (F2);
  96.         54      ||||           diskspace := 0.0;
  97.         55      ||||           writeln;
  98.         56      ||||           writeln ('   ...Continuing  ');
  99.         57      |||+--         end;
  100.         58      |||        readln (F1,line);
  101.         59      |||        writeln (F2,line);
  102.         60      |||        diskspace := diskspace + length(line) + 1;
  103.         61      ||+--      until eof(F1);
  104.  
  105.  
  106.      A≤á yo⌡ caε seσ thi≤ make≤ thσ locatinτ thσ Begin-enΣá pair≤ ì
  107. very simple
  108.  
  109.  
  110.      In version 3.5, marking of the reserved words was added due to
  111. programmers requesting it.  You see, I even listen to user comments.
  112. .pa
  113. èNow for the legal? requirements:
  114.  
  115.      Yo⌡á arσá specificall∙á alloweΣ t∩ usσá and/o≥á modif∙á thi≤ ì
  116. prograφ a≤ lonτ a≤ yo⌡ don'⌠ sel∞ i⌠ fo≥ profit«á  Pleasσ pas≤ i⌠ ì
  117. alonτá (UN-MODIFIED⌐ t∩ you≥ friends«á  Al∞ commercia∞ right≤ fo≥ ì
  118. this program are retained by the author.
  119.  
  120.  
  121. If you find this program usefull, please consider the amount of time
  122. and effort which went into this program.  A donation of $35 is
  123. required to become a registered user of this program, and intitles
  124. you to the source code, and a phone number for any questions.
  125.  
  126. Please mail registrations to:
  127.  
  128.      John Lindsay
  129.      ╡ HighlanΣ St.
  130.      Shrewsbury, Ma. 01545
  131.  
  132.  
  133.      This  concludes the document file,   I hope you  enjoy  this
  134. program.
  135.                     JSL
  136.