Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : READSTOR.PAS

 
Output of file : READSTOR.PAS contained in archive : PASTUT.ZIP
(* Chapter 11 - Program 3 *)
program Read_And_Store_A_File;

var Read_File : text;
Input_File_Name : string[12];
Write_File : text;
Output_File_Name : string[12];
Line_Number : integer;
Big_String : string[80];
Read_File_OK : boolean;

begin
Write('Enter input file name ');
Readln(Input_File_Name);
Assign(Read_File,Input_File_Name);
{$I-}
Reset(Read_File);
{$I+}
Read_File_OK := (IOResult = 0);
if Read_File_OK then begin
Write('Enter output file name ');
Readln(Output_File_Name);
Assign(Write_File,Output_File_Name);
Rewrite(Write_File);

Line_Number := 1;
while not Eof(Read_File) do begin
Readln(Read_File,Big_String);
Write(Write_File,Line_Number:5,' ');
Writeln(Write_File,Big_String);
Line_Number := Line_Number + 1;
end;
Close(Read_File);
Close(Write_File);
end
else
Writeln('Input file doesn''t exist, execution aborted');
end. (* of program *)




{ Result of execution

(The selected file is copied to the selected output file)

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : READSTOR.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/