Delphi-Quellcode:
if @DownloadBegin <> nil then
DownloadBegin(CurrentDownload);
if @DownloadEnd <> nil then
DownloadEnd(CurrentDownload);
if @DownloadWork <> nil then
begin
dieses ist immer <> nil, denn die Variablen sind immer vorhanden
Delphi-Quellcode:
if Assigned(DownloadBegin) then
DownloadBegin(CurrentDownload);
if Assigned(DownloadEnd) then
DownloadEnd(CurrentDownload);
if Assigned(DownloadWork) then
begin
// und wenn schon NIL, dann eher so
if Pointer(DownloadBegin) <> nil then
DownloadBegin(CurrentDownload);
Delphi-Quellcode:
// Standartwer falls Property nicht gesetzt = 2, urNormal
intRate := 2;
// urUpdateRate auswählen
case urUpdateRate of
urFast : begin intRate := 1; end;
urNormal : begin intRate := 2; end;
urSlow : begin intRate := 3; end;
end;
schonmal etwas vom ELSE gehört und wozu die Begin-End?
Delphi-Quellcode:
// urUpdateRate auswählen
case urUpdateRate of
urFast : intRate := 1;
urSlow : intRate := 3;
else intRate := 2;
end;
mit ein paar ELSE könne man einige Vergleiche eh weglassen, samt der "unnötigen" Exit.
ja meinst du, daß über 1 Terrabyte wirklich nötig sind?
PS: laut berechnung ist dein GB ein TB und GBhast du ganz vergessen

(1.099.511.627.776 = 1 TB)
Delphi-Quellcode:
function THTTPDownloader.GetSizeName(const Size : int64): String;
begin
if Size > 1073741824 then
Result := floattostr(trunc(Size/1073741824*100)/100)+' GB'
else if Size > 1048576 then
Result := floattostr(trunc(Size/1048576*100)/100)+' MB'
else if Size > 1024 then
Result := floattostr(trunc(Size/1024*100)/100)+' KB'
else if Size >= 0 then
Result := inttostr(Size)+' Byte'
else
Result := 'Error';
end;
.......
PS: von da drüben läßt sich dein Code nicht nutzen ... beim Rauskopieren wird da je Zeile eine Zeile mit 'nem # eingefügt ... voll unpraktisch
Ein Therapeut entspricht 1024 Gigapeut.