program calico(input, output); (* character and line counts of a file susan p. scolman copyright (c) 1986 module library: delman *) const (* begin module version *) version = 1.08; (* of calico.p 1993 January 27 origin: march 7, 1982 *) (* end module version *) (* begin module describe.calico *) (* name calico: character and line counts of a file synopsis calico(input: in, output: out); files input: a file for which one wants to know the number of characters and lines output: the number of characters and lines in input description there are many circumstances when one would like to know the number of characters and the number of lines in a file. examples will a file fit on one page? can this file be put into the memory of a personal computer for transportation to another computer? author susan p. scolman and thomas d. schneider bugs none known technical notes blanks at ends of lines are counted as characters. only the end of line mark is counted, not carriage return and line feed. *) (* end module describe.calico *) var tchars, (* total characters *) lines: integer; (* total lines *) begin (* calico *) writeln(output, ' calico ', version:4:2); tchars:=0; lines:=0; while not eof(input) do begin (* line count *) while not eoln(input) do begin (* character count *) get(input); tchars:=tchars+1 end; readln(input); lines:=lines+1 end; write (output,' the file contains'); writeln(output,' ',tchars:1,' characters and ',lines:1,' lines.'); end. (* calico *)