uses IniFiles;
procedure IncludeIniFile(Src, Dest : TIniFile);
var PE,NA,NB : integer;
VL,SL : TStringList;
VID,VVL : String;
begin
VL := TStringList.Create;
SL := TStringList.Create;
try
SL.BeginUpdate;
try
Src.ReadSections(SL);
finally
SL.EndUpdate;
end;
if SL.Count > 0 then
for NA := 0 to SL.Count-1 do
begin
VL.BeginUpdate;
try
Src.ReadSectionValues(SL[NA],VL);
finally
VL.EndUpdate;
end;
if VL.Count > 0 then
for NB := 0 to VL.Count-1 do
begin
PE := Pos('=',VL[NB]);
VID := Copy(VL[NB], 1, PE-1);
VVL := Copy(VL[NB], PE+1, Length(VL[NB])-PE);
Dest.WriteString(SL[NA],VID,VVL);
end;
end;
finally
SL.Free;
VL.Free;
end;
end;