home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Education Master 1994 (4th Edition)
/
EDUCATIONS_MASTER_4TH_EDITION.bin
/
files
/
progscal
/
ptutor2b
/
readdisp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
802b
|
29 lines
(* Chapter 11 - Program 2 *)
program Read_And_Display;
var Chicken : text;
Name_Of_File_To_Input : string[12];
Line_Count : integer;
Big_String : string[80];
begin (* main program *)
Write('Enter input file name ');
Readln(Name_Of_File_To_Input);
Assign(Chicken,Name_Of_File_To_Input);
Reset(Chicken);
Writeln;
Writeln('Program listing with character count per');
Writeln('line and total line count');
Writeln;
Line_Count := 0;
while not Eof(Chicken) do begin
Readln(Chicken,Big_String);
Writeln(Length(Big_String):5,' ',Big_String);
Line_Count := Line_Count + 1;
end;
Close(Chicken);
Writeln;
Writeln('The line count is ',Line_Count:3);
end. (* of program *)