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 / ruler.icn < prev    next >
Text File  |  2000-07-29  |  945b  |  36 lines

  1. ############################################################################
  2. #
  3. #    File:     ruler.icn
  4. #
  5. #    Subject:  Program to write a character ruler
  6. #
  7. #    Author:   Robert J. Alexander
  8. #
  9. #    Date:     December 5, 1989
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  Write a character ruler to standard output.  The first optional
  18. #  argument is the length of the ruler in characters (default 80).
  19. #  The second is a number of lines to write, with a line number on
  20. #  each line.
  21. #
  22.  
  23. procedure main(arg)
  24.    local length, ruler, lines, i
  25.  
  26.    length := "" ~== arg[1] | 80
  27.    every writes(right(1 to length / 10,10))
  28.    ruler := right("",length,"----+----|")
  29.    if lines := arg[2] then {
  30.       write()
  31.       every i := 2 to lines do
  32.      write(i,ruler[*i + 1:0])
  33.       }
  34.    else write("\n",ruler)
  35. end
  36.