home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPUHEAD.ZIP / TPUHEAD.DOC next >
Encoding:
Text File  |  1988-06-04  |  2.8 KB  |  58 lines

  1.  
  2.                                TPUHEAD
  3.  
  4.   A program to copy the HEADER (everything from the top through the
  5.   IMPLEMENTATION) of a TP4 Unit into a separate file for reference
  6.   purposes.
  7.  
  8.   TPUHead accepts standard wildcards (*,?) when specifying the files
  9.   to process as well as drive & path.
  10.  
  11.                   e.g.,  TPUHEAD d:\tpufiles\*.pas
  12.  
  13.   Each file meeting the user criteria is evaluated.  It is determined
  14.   to be a valid TP4 unit if the keywords UNIT, INTERFACE, & IMPLEMENTATION
  15.   are found, in order, and within the first 10 charcters on a line.  This
  16.   was necessary since I often put in comments which would otherwise cause
  17.   TPUHEAD to think the file was a unit when in fact it was not.
  18.  
  19.   Further, only files which have not been processed, or those which need
  20.   to have updates are processed.  The trigger is date matching between the
  21.   TPUHEAD output file  ".TOP" & the source.  When a .TOP file is created,
  22.   it is date stamped exactly as the source.  Thus, if a source file is
  23.   later updated (getting a new update date), TPUHEAD can identify it as
  24.   needing updating.  Otherwise, it is skipped.
  25.  
  26.   By the way, the .TOP file is given the same filename as the source.  The
  27.   file extent becomes ".TOP".
  28.  
  29.   As files are processed, the output filename is shown on the screen.  You
  30.   may find this strange  ( e.g.,  "type SOURCE.TOP >> %1").  Actually, it
  31.   is done to minimize steps necessary to later concat all output files
  32.   into a single file.  Why?  I use WordPerfect.  Once I have the single
  33.   file created, I go into WP, search for "== END" and start a new page.
  34.   Then I build a Table of Contents & an Index (using my own concordance
  35.   generator ... look for it soon).  When finished, I have a notebook with
  36.   all unit interface sections.  No more looking for files & trying to read
  37.   them online, or digging for the full print out to find what functions &
  38.   procedures are there and how to call them.
  39.  
  40.   If you notice in the example given in the preceding paragraph, it shows
  41.   the output including the redirection symbol ">>".  For this to make sense,
  42.   the first output should also be redirected to a batch file;
  43.  
  44.                    e.g., TPUHEAD *.pas > headers.bat
  45.  
  46.   Then each of the "type .... >> %1" lines of output are directed into the
  47.   specified batch file.  When the batch file is run;
  48.  
  49.                    e.g., headers Headers.All
  50.  
  51.   The individual ".TOP" files are concatenated into HEADERS.ALL which can
  52.   then be used in your word processor.  (Of course, all the separate .TOP
  53.   files are still there.  Be sure to keep them if you want TPUHEAD to be
  54.   able to determine which files do/do not need updating.
  55.  
  56.   These techniques were possible by using TP4's FINDFIRST/FINDNEXT procs
  57.   along with the redefinition of the "standard" output.
  58.