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 >
Wrap
Text File
|
2000-07-29
|
945b
|
36 lines
############################################################################
#
# 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