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 / genfile.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  48 lines

  1. ############################################################################
  2. #
  3. #    File:     genfile.icn
  4. #
  5. #    Subject:  Program to generate sequence from Icon expression in file
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     January 22, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program writes the results of an Icon expression given in the file
  18. #  named on the command line.
  19. #
  20. ############################################################################
  21. #
  22. #  Requires:  system(), pipes
  23. #
  24. ############################################################################
  25. #
  26. #  Links:  exprfile
  27. #
  28. ############################################################################
  29.  
  30. link exprfile
  31.  
  32. procedure main(args)
  33.    local expression, input, limit
  34.  
  35.    limit := 1000        # AD HOC; make option.
  36.  
  37.    input := open(args[1]) | stop("*** cannot open file")
  38.  
  39.    expression := read(input) | stop("*** empty file")
  40.  
  41.    close(input)
  42.  
  43.    input := exprfile(expression, "seqfncs")
  44.  
  45.    every write(!input) \ limit
  46.  
  47. end
  48.