home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / printimage_394.lzh / 'Liner / rexx / CountLinesAndWords.rx next >
Text File  |  1990-10-28  |  752b  |  29 lines

  1. /*Counts the total number of lines and words in the current outline*/
  2.  
  3. address 'liner'
  4.  
  5. options results
  6.  
  7. 'totop'           /*Go to the top*/
  8. 'getlinetext'     /*Get the first line of text*/
  9.  
  10. oldresult = "fwh8i3oihfi"
  11.  
  12. TotalWords = 0
  13. TotalLines = 0
  14.  
  15. do until result = oldresult   /*Do until the current line and the previous*/
  16.                               /*match (i.e. cursor couldn't go down;  hmmm*/
  17.                               /*future plan:  have cursordown (& up) */
  18.                               /*return a result*/
  19.    TotalLines = TotalLines + 1
  20.    TotalWords = TotalWords + words(result)
  21.    oldresult = result
  22.    'cursordown'
  23.    'getlinetext'
  24. end
  25.  
  26. echo "There were " || TotalLines || " lines."
  27. echo "There were " || TotalWords || " words."
  28.  
  29.