home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- #
- # File: longest.icn
- #
- # Subject: Program to write length of longest line in a file
- #
- # Author: Ralph E. Griswold
- #
- # Date: February 22, 1992
- #
- ###########################################################################
- #
- # This little programs just writes the length of the longest line in
- # standard input. Hardly worth the trouble, but it's been handy.
- #
- ############################################################################
-
- procedure main()
- local line, max, save
-
- max := 0
- while line := read() do
- if max <:= *line then save := line
- write(save)
- end
-