program convert;

uses Printer;
type
 CodeStr=string[8];
 NameStr=string[20];

 SymbRec=record
    CodeK:CodeStr;
    LastName:NameStr;
    Firstname:string[17];
    PatrName:string[17];
    BM:Integer;
    Symbolaio:string[7];
    Ananeosi:string[7];
    ProsthPraxi:string[7];
    DiarApo:string[8];
    DiarEos:string[8];
    Kathara:real;
    PosProm:real;
    Prom:real;
    Mikta:real;
    Flag_exof:boolean;
    Ypoloipo_symb:Longint;
    Para:string[80];
    end;

  PayRec=record
    CodeK:CodeStr;
    ArSymb:string[7];
    ProkDate:string[8];
    ProkApo:integer;
    ProkAxia:Longint;
    ExofDate:string[8];
    ExofApo:integer;
    Pis:string[5];
    Eidop:string[8];
    Akyros:string[8];
    end;


 NewSymbRec=record
    CodeK:CodeStr;
    LastName:NameStr;
    Firstname:string[17];
    PatrName:string[17];
    BM:Integer;
    Symbolaio:string[7];
    Ananeosi:string[7];
    ProsthPraxi:string[7];
    DiarApo:string[8];
    DiarEos:string[8];
    Kathara:real;
    PosProm:real;
    Prom:real;
    Mikta:real;
    Flag_exof:boolean;
    Ypoloipo_symb:Longint;
    Pis:string[5];
    Eidop:string[8];
    Akyros:string[8];
    Para:string[80];
    end;

  NewPayRec=record
    CodeK:CodeStr;
    ArSymb:string[7];
    ProkDate:string[8];
    ProkApo:integer;
    ProkAxia:Longint;
    ExofDate:string[8];
    ExofApo:integer;
    end;




const

    SymbFileNm='FLSYMB.dat';
    PaymentFileNm='FLPAYM.dat';

    NewSymbFileNm='FLSYMB.new';
    NewPaymentFileNm='FLPAYM.new';

var
  SymbFile:File of SymbRec;
  PaymentFile: File of PayRec;
  Symb:SymbRec;
  Payment  :PayRec;

  NewSymbFile:File of NewSymbRec;
  NewPaymentFile: File of NewPayRec;
  NewSymb:NewSymbRec;
  NewPayment  :NewPayRec;
  Symbolrec,PaymentRec:longint;



begin
     assign(SymbFile,SymbFileNm);
     assign(NewSymbFile,NewSymbFileNm);
     assign(PaymentFile,PaymentFileNm);
     assign(NewPaymentFile,NewPaymentFileNm);

     reset(SymbFile);
     reset(PaymentFile);
     rewrite(NewSymbFile);
     rewrite(NewPaymentFile);

     {‹œ«˜«¨¦§ã ˜¨®œå¦¬ ©¬£™¦¢˜åà¤}

     For Symbolrec:=0 to FILESIZE(SymbFile)-1 do
     begin
         seek(SymbFile,SymbolRec);
         read(SymbFile,Symb);
    NewSymb.CodeK:='';
    NewSymb.BM:=0;
    NewSymb.LastName:='';
    NewSymb.FirstName:='';
    NewSymb.PatrName:='';
    NewSymb.Symbolaio:='';
    NewSymb.Ananeosi:='';
    NewSymb.ProsthPraxi:='';
    NewSymb.DiarApo:='';
    NewSymb.DiarEos:='';
    NewSymb.Kathara:=0;
    NewSymb.PosProm:=0;
    NewSymb.Prom:=0;
    NewSymb.Mikta:=0;
    NewSymb.Flag_exof:=false;
    NewSymb.Ypoloipo_symb:=0;
    NewSymb.Para:='';
    NewSymb.Pis:='';
    NewSymb.Eidop:='';
    NewSymb.Akyros:='';

    NewSymb.CodeK:=Symb.CodeK;
    NewSymb.BM:=Symb.BM;
    NewSymb.LastName:=Symb.LastName;
    NewSymb.FirstName:=Symb.FirstName;
    NewSymb.PatrName:=Symb.PatrName;
    NewSymb.Symbolaio:=Symb.Symbolaio;
    NewSymb.Ananeosi:=Symb.Ananeosi;
    NewSymb.ProsthPraxi:=Symb.ProsthPraxi;
    NewSymb.DiarApo:=Symb.DiarApo;
    NewSymb.DiarEos:=Symb.DiarEos;
    NewSymb.Kathara:=Symb.Kathara;
    NewSymb.PosProm:=Symb.PosProm;
    NewSymb.Prom:=Symb.Prom;
    NewSymb.Mikta:=Symb.Mikta;
    NewSymb.Flag_exof:=Symb.Flag_exof;
    NewSymb.Ypoloipo_symb:=Symb.Ypoloipo_symb;
    NewSymb.Para:=Symb.Para;
    NewSymb.Pis:='';
    NewSymb.Eidop:='';
    NewSymb.Akyros:='';

         seek(NewSymbFile,SymbolRec);
         write(NewSymbFile,NewSymb);
   end;
   close(SymbFile);
   close(NewSymbFile);



 For Paymentrec:=0 to FILESIZE(PaymentFile)-1 do
   begin
         seek(PaymentFile,PaymentRec);
         read(PaymentFile,Payment);
         seek(NewPaymentFile,PaymentRec);
         write(NewPaymentFile,NewPayment);
   end;

   close(NewPaymentFile);


end.