home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / ibm1 / ralphson.arj / WC / WC.DOC next >
Encoding:
Text File  |  1991-10-28  |  5.8 KB  |  187 lines

  1.  
  2.          WC.DOC - Documentation for WordCount version 1.23  28/10/1991
  3.  
  4.     Documentation and executable code Copyright (c) 1991 Michael E. Ralphson
  5.  
  6.  
  7. Disclaimer:
  8. ===========
  9.  
  10. The Author retains copyright in that he alone has the right to make copies for
  11. profit. In all other respects users may treat this software as if it were in
  12. the Public Domain, as long as the package is distributed whole and unmodified.
  13.  
  14. In my opinion this software is perfectly safe and is free of any serious bugs,
  15. however I have to make it clear that use of this software constitutes the
  16. user's full acknowledgement that the author takes no responsibility WHATSOEVER
  17. for the consequences of such use.
  18.  
  19. Commercial users must register within 30 days if they wish to continue using
  20. this software. For non-commercial users registration is purely voluntary.
  21.  
  22. See the enclosed REGISTER.DOC for more information.
  23.  
  24.  
  25. Introduction:
  26. =============
  27.  
  28. WordCount is an ASCII-text word, line and page counting program for
  29. word-processors and text editors that do not provide these features as
  30. standard. It is useful on the DOS command-line as well as being called from a
  31. macro in your word-processor.
  32.  
  33. The above was the original plan for WordCount, and things have changed a bit
  34. since then...
  35.  
  36. WordCount is intended to be small, fast, flexible and easy to use.
  37.  
  38.  
  39. Usage:
  40. ======
  41.  
  42. WC <param> [<param>...]
  43.  
  44. Where <param> is a text file, a list of filenames to count or an option.
  45.  
  46. Note: WC with no parameters produces a summary of these instructions.
  47.  
  48.  
  49. Word-processor Macros:
  50. ======================
  51.  
  52. A word-processor macro should run along the following lines: save the current
  53. document in non-document (ASCII) mode, then shell to DOS issuing the command:
  54.  
  55.  WC.EXE <current_filename>
  56.  
  57. If your WP does not provide for the transmission of the current filename to
  58. external programs in this manner, you should set up a batch file as below and
  59. use it to run your WP:
  60.  
  61.  Echo Off
  62.  Echo %1>WC.TMP
  63.  WP %1
  64.  If Exist WC.TMP Del WC.TMP>Nul
  65.  
  66. Your macro should now consist of saving the current file, followed by a call to
  67. DOS with the command:
  68.  
  69.  WC.EXE @WC.TMP
  70.  
  71.  
  72. Text files:
  73. ===========
  74.  
  75. WC assumes DOS standards such as lines terminated with carriage returns and
  76. line feeds (used in line and page counting, not word counting), though it does
  77. not require an end of file marker. WC can also handle WordStar (tm) files, see
  78. below.
  79.  
  80.  
  81. List files:
  82. ===========
  83.  
  84. A list file is a file containing a list of text files to be processed by WC,
  85. one file-specification per line. On the WC command-line the name of a list must
  86. be preceded by an 'at symbol' (@) character.
  87.  
  88. Due to a (useful) quirk in Turbo Pascal (tm), using @ on its own as a list file
  89. name causes WC to get the list of file names to process from the keyboard. Type
  90. a CTRL-Z character to end keyboard input if you use this feature.
  91.  
  92. Files taken from a list are shown indented one space on the screen. Failure to
  93. find a file (list or text) will not halt the program, it will continue until
  94. the command-line is exhausted.
  95.  
  96. List files may not contain more lists. A word-counting program shouldn't need
  97. recursion!
  98.  
  99. Lists are useful when the same set of files must be counted several times and
  100. their filenames cannot be expressed simply as sets of wild cards.
  101.  
  102.  
  103. Wild cards:
  104. ===========
  105.  
  106. Both filenames given on the command-line and those in lists may include
  107. wildcards (* and ?). Extended wildcard specifications such as C:\*.T* which
  108. confuse certain versions of DOS, may be used.
  109.  
  110. Note: Wildcards may not be used in list file names, eg: @*.LST
  111.  
  112.  
  113. Options:
  114. ========
  115.  
  116. Most WC options follow the usual standard of /<letter><+|->
  117.  
  118.  /<letter>+ turns the option ON, /<letter>- turns it OFF, /<letter> toggles it
  119.  
  120. The N option, which controls whether WC counts strings of numbers as words,
  121. defaults to ON.
  122.  
  123. The W option, which controls WordStar (tm) compatability, defaults to OFF.
  124.  
  125. The S option, which controls whether WC splits lines that are longer than the
  126. line limit (initially 80 characters, see /L), defaults to ON.
  127.  
  128. The D option, which controls whether WC displays each word as it is counted,
  129. defaults to OFF (this was originally a debugging feature)
  130.  
  131. The F option, which controls whether WC calculates a Fog-Index (averge word
  132. length indicator) for each file, defaults to OFF.
  133.  
  134. The next three options, which define WC's page length and line width are
  135. slightly different:
  136.  
  137.  /Pnn sets the page length to nn lines. It defaults to 66, and /P on its own
  138.  will reset this value.
  139.  
  140.  /Lnn sets the line width to nn characters. It defaults to 80, and /L on its
  141.  own will reset this value.
  142.  
  143.  /Rn.n sets the word rate to n.n pounds for writers who are paid by the word.
  144.  For example, /R0.01 would be 1p per word. The default is 0.0 (not calculated).
  145.  
  146. Options can be used anywhere on the command-line (but not in lists!), so as to
  147. bracket one or more files:
  148.  
  149. WC *.txt /w *.WS /w /n /l120 *.acc
  150.  
  151. All .TXT files are processed according to the defaults
  152.  
  153. All .WS files are processed as WordStar files
  154.  
  155. All .ACC files are processed as having a line length of 120 characters, and
  156. numbers are not counted as words
  157.  
  158.  
  159. General bits:
  160. =============
  161.  
  162. If more than one file was successfully read, a table of totals and averages is
  163. displayed. Writers who are paid by the word will be glad to know WC rounds up.
  164.  
  165. Output from WC is fully redirectable.
  166.  
  167. WC requires a fair chunk of memory (the length of the file or 64k, whichever is
  168. smaller), but can handle any size of file.
  169.  
  170.  
  171. Version history:
  172. ================
  173.  
  174.  1.00    Original non-release version, personal use only
  175.  
  176.  1.01    As above
  177.  
  178.  1.02    Bug fix, tidying. Released as part of WC-ETC utilities
  179.  
  180.  1.10    Improved handling of larger files
  181.  
  182.  1.20    Wild cards, list files etc
  183.  
  184.  1.21    Fine tuning of count routines, more options
  185.  
  186.  1.23   Line count works with TextUtil compression, word rate
  187.