Autor Beitrag
Horst1
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Sa 29.06.02 20:52 
Hallo an alle möchte, während unten angezeigter vorgang läuft, in einer progressbar anzeigen wie lange es noch dauert...
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
procedure TForm1.austauschen(Datei1,Datei2 : String);  
VAR  
dat,dat2:textfile;  
buf,buf2,buf3:string;  
i:integer;  
begin  
//dat := 'test.txt');  
//dat2:=(test2.txt);  
AssignFile(dat, Datei1);  
  AssignFile(dat2, Datei2);  
{$I-}  
reset(dat);  
Rewrite (dat2);  
{$I+}  
if ioresult=0 then  
begin  
while not eof(dat) do  
begin  
readln(Dat,Buf);  
I:= pos ('"',buf);  
while i >0 do  
begin  
  buf2:=copy(buf,0,i -1);  
  buf3 :=copy(buf,i +1,200);  
  buf:=buf2+buf3;  
    I:= pos ('"',buf);  
  end;  writeln(dat2,buf)  
end;  
closefile(dat);  
closefile(dat2);    showmessage('fertig');  end;  
end;  procedure TForm1.Button1Click(Sender: TObject);  
  var  
  datei1, datei2:string;  
begin  
if opendialog1.Execute then  
begin  
datei1:=opendialog1.FileName;  
if savedialog1.Execute then  
begin  
datei2:=savedialog1.FileName;  
end;  
austauschen(datei1,datei2);  
end;
MathiasH
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 699

WinXP, Win98SE, Debian, Win95
D5 Stand, D6 Prof
BeitragVerfasst: So 30.06.02 11:29 
kanns du das nicht etwas genauer beschreiben?
bis man hinter die Funktin eines Fremden quelltexts kommt braucht man sonst ziehmlich lang(was tu dein progi den überhaupt?)

Mathias

_________________
"Viel von sich reden, kann auch ein Mittel sein, sich zu verbergen."
Friedrich Nietzsche
Horst1 Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: So 30.06.02 13:55 
danke erstmal, mit dem code wird ein zeichen " aus einer textdatei entfernt...
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Mo 01.07.02 11:10 
Dazu must du eine Progressbar einbinden, und Progressbar.Max die Anzahl der Zeilen zuweisen. Dann kannst du dieses anzeigen....
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
while not eof(dat) do  
begin  
readln(Dat,Buf);  
I:= pos ('"',buf);  
while i >0 do  
begin  
  buf2:=copy(buf,0,i -1);  
  buf3 :=copy(buf,i +1,200);  
  buf:=buf2+buf3;  
    I:= pos ('"',buf);  
  end;  
writeln(dat2,buf)  
Progressbar.Position:= Progressbar.Position + 1;
Progressbar.Update;
end;


Code-Tags hinzugefügt. Tino

_________________
Keine Signatur ...