Problem on merging files

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
mediatech
Posts: 23
Joined: Fri Mar 11, 2005 6:02 am

Problem on merging files

Post 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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

You need to call SaveAllToFile() to save merged content to file.
Best regards,
Igor Siticov.
Post Reply