program MergeFiles(F,G,H); { Program 9.2 - Merge files F and G sorted by last name into H. } type Natural = O .. Maxlnt; String15 = packed array [1 .. 15] of Char; Person = record Name: record First, Last: String15; end; Height: Natural { centimeters end; var F, G, H: file of Person; EndFG: Boolean; begin Reset(F); Reset(G); Rewrite(H); EndFG := Eof(F) or Eof(G); while not EndFG do begin if Fi.Name.Last < Gi.Name.Last then begin Hi:= Fi; Get(F); EndFG:= Eof(F) end else begin Hi:= Gi; Get(G); EndFG.- Eof(G) end; Put (H) end; while not Eof(G) do begin Write(H, Gi); Get(G) end; while not Eof(F) do begin end Write(H, Fi); Get(F) end 

