NBPrg40. (*EXT31). (**lst.ed). EDFP.PAS. MiniOS. OpenSource.

NBPrg40. (*EXT31). (**lst.ed). EDFP.PAS. MiniOS. OpenSource.
**************************************

{ Nikita Beloshenko (GNU) 2013 }

Unit edfp;

{ edfp = E D F I L E + Path - loop }

(*

   EDFP.PAS

   +---------------------------+ 
   |                           | 
   |      E D F I L E          | 
   |                           |  
   +---------------------------+ *)

Interface

Procedure edfp_run(Var Path :String);

Implementation

{ Edit File , edfp = edit file , path }
Procedure edfp_run(Var Path :String);
Var
  Name,S : String;
  S1     : String;
  T,T1   : Text;
  N,i    : Integer;
  Ch     : Char;
Begin

  WriteLn(' edfp = edit file , path ');
  WriteLn(' edfp = E D F I L E + Path - loop ' );
  WriteLn(' ');
  WriteLn(' +---------------------------+ ');
  WriteLn(' |                           | ');
  WriteLn(' |      E D F I L E (edfp)   | ');
  WriteLn(' |                           | ');
  WriteLn(' +---------------------------+ ');
  WriteLn('                               ');
  WriteLn(' Nikita Beloshenko (GNU) 2013 ');
  WriteLn(' ----- File->(Edit) 2013 {(text) (module)} ----- ');

  WriteLn(' ');

  Name := Path; { external path , edfp }

  {

  WriteLn(' Name? ');

  ReadLn(Name);

  } { from E D F I L E }

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

  Assign(T1,'EDBuf.tmp');
  ReWrite(T1);

  While Not eof(T) Do
  Begin
    ReadLn(T,S);
    WriteLn(S);
    S1 := '';
    While ((S1<>'y') And (S1<>'n')) Do
    Begin
      WriteLn('----- ?(new string)?>y/n -----');
      ReadLn(S1);
    End;
    If S1='y' Then
    Begin
      WriteLn('----- ?(new string)?> -----');
      ReadLn(S);
    End;
    WriteLn(T1,S);
  End;

  Close(T1);

  Close(T);

  { REWRITE }

  Assign(T,Name);
  ReWrite(T);

  Assign(T1,'EDBuf.tmp');
  Reset(T1);

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

  Close(T1);

  Close(T);

  { PAUSE }

  WriteLn(' End of file. Press ENTER. ');
  ReadLn;

End;

End.