############################################################################
#
#	File:     ruler.icn
#
#	Subject:  Program to write a character ruler
#
#	Author:   Robert J. Alexander
#
#	Date:     December 5, 1989
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  Write a character ruler to standard output.  The first optional
#  argument is the length of the ruler in characters (default 80).
#  The second is a number of lines to write, with a line number on
#  each line.
#

procedure main(arg)
   local length, ruler, lines, i

   length := "" ~== arg[1] | 80
   every writes(right(1 to length / 10,10))
   ruler := right("",length,"----+----|")
   if lines := arg[2] then {
      write()
      every i := 2 to lines do
	 write(i,ruler[*i + 1:0])
      }
   else write("\n",ruler)
end
