Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Sa 25.02.06 00:09 
Hallo,

Ich habe hier in eine ListBox sehr viele Dateien (ca. 2000) geladen (also immer der komplette Pfad zur Datei). Hintereinanderweg. Ich möchte diese Daten kopieren und zwar mit einer Progressbar. Dazu möchte ich die Gesamtgröße aller Dateien berechnen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var l:longint;
    i:integer;
    File1: file of byte;
begin
  i:=0;
  l:=0;
  for i:=0 to ListBox1.Items.Count-1 do begin
  assignfile(File1,ListBox1.Items[i]);
  l:=l+FileSize(File1);
  end;


Leider kommt beim ausführen des Codes: "E/A Fehler 2" und der Compiler springt an die Stelle " l:=l+FileSize(File1);". Was mache ich falsch ?

Ciao LHUser
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Sa 25.02.06 14:55 
Hat sich erledigt. Ich habe es über die Count Eigenschaft der ListBox.Items gemacht. Jetzt gehts :)