home *** CD-ROM | disk | FTP | other *** search
- (* Chapter 11 - Programming exercise 2 *)
- program Read_And_Count;
-
- var Turkey : TEXT;
- Big_String : string[80];
- Line_Size : integer;
- Line_Count : integer;
-
- begin (* main program *)
- Assign(Turkey,'CH11_2.PAS');
-
- Reset(Turkey);
- Line_Count := 0;
- while not Eof(Turkey) do begin
- Readln(Turkey,Big_String);
- Write(Length(Big_String):6);
- Writeln(' ',Big_String);
- Line_Count := Line_Count + 1;
- end; (* of while loop *)
-
- Writeln;
- Writeln('The total line count is',Line_Count:4);
-
- Close(Turkey);
- end. (* of program *)
-
-
-
-
- { Result of execution
-
- (This file is displayed on the monitor with character counts)
-
- }
-