NBPrg40. (*Ext_source). (**CPFILE). CPFILE.PAS. MiniOS. OpenSource.

NBPrg40. (*Ext_source). (**CPFILE). CPFILE.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013 }

Unit CPFILE;

(*
   CPFILE.PAS

   +---------------------------+ 
   |                           | 
   |      C P F I L E          | 
   |                           | 
   +---------------------------+ *)

Interface

Procedure CopyFILE_run;

Implementation

{ File->(Copy) }
Procedure CopyFILE_run;
Label
  START;

Var
  Name,S : String;
  Name1  : String;
  T,T1   : Text;

Begin

START :

  WriteLn(' +---------------------------+ ');
  WriteLn(' |                           | ');
  WriteLn(' |      C P F I L E          | ');
  WriteLn(' |                           | ');
  WriteLn(' +---------------------------+ ');
  WriteLn('                               ');
  WriteLn(' Nikita Beloshenko (GNU) 2013 ');
  WriteLn(' ----- File->(Copy) 2013 {(text) (module)} ----- ');

  WriteLn(' ');

  WriteLn(' Name? (SOURCE) ');

  ReadLn(Name);

  WriteLn(' Name1? (COPY TO)=(WRITE TO) ');

  ReadLn(Name1);

  { COPY }

  Assign(T,Name);
  Reset(T);

  Assign(T1,Name1);
  ReWrite(T1);

  While Not eof(T) Do
  Begin
    ReadLn(T,S);
    WriteLn(T1,S);
  End;

  Close(T1);

  Close(T);

  { GOTO START ? }

  S := '';

  While ((S<>'y') And (S<>'n')) Do
  Begin
    WriteLn(' ----- GOTO START? (Another File) ----- ');
    WriteLn('y/n');
    ReadLn(S);
  End;

  If S='y' Then Goto START;

End;

End.