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