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 / vrepl.icn < prev    next >
Text File  |  2000-07-29  |  821b  |  33 lines

  1. ############################################################################
  2. #
  3. #    File:     vrepl.icn
  4. #
  5. #    Subject:  Program to replicate input lines
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     January 14, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program replicates every line of standard input a specified
  18. #  number of times and writes the result to standard output.  The
  19. #  replication factor is given on the command line.
  20. #
  21. ############################################################################
  22.  
  23. procedure main(args)
  24.    local i, line
  25.  
  26.    i := integer(args[1]) | 1
  27.  
  28.    while line := read() do
  29.       every 1 to i do
  30.          write(line)
  31.  
  32. end
  33.