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 / revfile.icn < prev    next >
Text File  |  2000-07-29  |  697b  |  32 lines

  1. ############################################################################
  2. #
  3. #    File:     revfile.icn
  4. #
  5. #    Subject:  Program to reverse the order of lines in a file
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     August 11, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program reverses the order of lines in a file.  Beware of large
  18. #  files.
  19. #
  20. ############################################################################
  21.  
  22. procedure main()
  23.    local lines
  24.  
  25.    lines := []
  26.  
  27.    every push(lines, !&input)
  28.  
  29.    every write(!lines)
  30.  
  31. end
  32.