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 / scale.icn < prev    next >
Text File  |  2000-07-29  |  967b  |  38 lines

  1. ############################################################################
  2. #
  3. #    File:     scale.icn
  4. #
  5. #    Subject:  Program to scale numeric values in visualization stream
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     January 20, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.  
  14. #
  15. ############################################################################
  16. #
  17. #  This program scales the numerical channel of a visualization stream.
  18. #  It leaves color channel alone, if there is one.  Scale factor is
  19. #  given on command line; default 10.
  20. #
  21. #  Note:  This program can be used on a numerical stream.
  22. #
  23. ############################################################################
  24.  
  25. procedure main(args)
  26.    local factor, line, i
  27.  
  28.    factor := \args[1] | 10
  29.  
  30.    while line := read() do {
  31.       line ? {
  32.          i := tab(upto(' \t') | 0)
  33.          write(i * factor, tab(0))
  34.          }
  35.       }
  36.  
  37. end
  38.