View Single Post
  #6  
Old 02-07-2021, 15:15
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
Code:
function ProgressCallback(OveralPct, CurrentPct: Integer; CurrentFile, TimeStr1, TimeStr2, TimeStr3: PAnsiChar): LongWord;
var
  CurTick: DWORD;
begin
    Memo.Lines.Add('Unpacking: ' + CurrentFile);
I thought maybe I could make a temporary string variable and comparing it with the current file and if so, skip echoing the current file, I am interested if anyone has any thoughts on this.
Another option is to use it this way.
I don't know if the filenames are partially cut off or not.
Let's say you have 2 files with same names in somewhat similar paths then the second file will also be displayed.

Example:
1) Data1.bin destination {app}\bin
FileName = Bin32\File1.txt
FileName = Bin32\File2.txt
2) Data2.bin destination {app}\
FileName = Bin\Bin32\File1.txt
FileName = Bin\File3.txt

In this case there are similar names as long as it is not the same name as the previous line, it will be added.
Code:
if (Memo.Lines.Count = 0) or (CompareText(Memo.Lines.Strings[Memo.Lines.Count - 1], 'Unpacking: ' + CurrentFile) <> 0) then
  Memo.Lines.Add('Unpacking: ' + CurrentFile);
Reply With Quote
The Following 3 Users Say Thank You to Cesar82 For This Useful Post:
DiCaPrIo (03-07-2021), GaMEr_2077 (02-07-2021), Masquerade (03-07-2021)