Page 1 of 1

Problem on merging files

Posted: Mon Feb 20, 2006 8:14 am
by mediatech
i tried to merge SIL-files with following code:

...
...
...
procedure MergeFile(sUpdSil: string);
begin
if FileExists(sLAngDir+'\'+sUpdSil) then
begin //Merge files
siLAng1.SILFile:= sLangDir+'\'+sUpdSil;
siLang1.LoadAllFromFile(sLAngDir+'\'+sUpdSil, true);
if (siLAng1.MergeAllFromFile(sUpdDir+'\'+sUpdSil)) then
_MTDeleteFile(sUpdDir+'\'+sUpdSil);
end //merge files
else begin //new file copy
if (_MTCopyFile(sUpdDir+'\'+sUpdSil, sLAngDir+'\'+sUpdSil, false)) then
_MTDeleteFile(sUpdDir+'\'+sUpdSil);
end; //new file, copy
end;
...
...
...

sUpdFIle is a SIL FIle that contains update items or a new file. "sLAngDir" is the directory with the sil-files used by application, supddir is a directory with new/updated sil-files.
The "mergeallfromfile"-function returns "true", but neither an existing item is updated nor new items are in the sil-file after merging.

What´s going wrong ?

Best regards

Andreas

Posted: Mon Feb 20, 2006 9:58 am
by isiticov
You need to call SaveAllToFile() to save merged content to file.