hab noch was anderes für dich:
Freigabe von SearchRec berichtigt (siehe Beispiel in der
OH):
Delphi-Quellcode:
Function GetFileSize(FileName: String): Integer;
Var SR: TSearchRec;
Begin
If FindFirst(Filename, faAnyFile, SR) = 0 Then Begin
Result := SR.Size;
{} FindClose(SR);
End Else Result := -1;
End;
Ein bissl Codeoptinierung:
Delphi-Quellcode:
Function Status(Wert: Integer; FileSize: Int64): String;
Var I: Integer;
Begin
If Wert = sfvfile.count Then
{} Result := '[AA] - ( ' + IntToStr(sfvfile.count) + 'F ' + IntToStr(FileSize shr 20) + 'M - COMPLETE ) - [AA]'
Else Begin
Result := '[';
{} For I := 1 to ((Wert * sfvfile.count) div 1000) do
Result := Result + '#';
{} For I := ((Wert * sfvfile.count) div 1000) + 1 to 10 do
Result := Result + '-';
{} Result := Result + '] - ' + IntToStr((Wert * sfvfile.count) div 100) + '% Complete - [AA]';
End;
OldStatus := Result;
End;
Delphi-Quellcode:
{10 Bit = 1024}
X div 1024 div 1024 = X shr 20 {arbeitet schneller}