home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / former.icn < prev    next >
Text File  |  2000-07-29  |  867b  |  34 lines

  1. ############################################################################
  2. #
  3. #    File:     former.icn
  4. #
  5. #    Subject:  Program to format long string in fixed-length lines
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     June 10, 1995
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program takes a single line of input and outputs in in lines
  18. #  no greater than the number given on the command line (default 80).
  19. #
  20. ############################################################################
  21.  
  22. procedure main(args)
  23.    local limit, line
  24.  
  25.    limit := integer(args[1]) | 80
  26.  
  27.    line := read() | stop("*** no input line")
  28.  
  29.    line ? {
  30.       while write(move(limit))
  31.       if not pos(0) then write(tab(0))
  32.       }
  33. end
  34.