Registriert seit: 27. Jun 2004
18 Beiträge
|
feher bei übergabe..textfile
1. Mai 2006, 15:03
hallo miteinander..
habe mal wieder ein problem und zwar bekomme ich immer den e/a fehler 103 oder 105.
ich möchte eine datei aus der ich vorher daten ausgelesen habe am endeüberschreiben..
und da hackt es ..
Delphi-Quellcode:
procedure TForm1.Button5Click(Sender: TObject);
var
lb,lb1:integer;
tsn:integer;
tsie: string;
begin
radiobutton1.Checked:=false;
radiobutton2.Checked:=false;
radiobutton3.Checked:=false;
assignfile(w,' world.save');
reset (w);
rewrite (c,' world.save.bk');
rewrite (o,' save\world.save');
repeat
readln (w,line);
writeln (c,line);
writeln (o,line);
until eof (w);
closefile (c);
closefile (o);
repeat
assignfile(w,' world.save');
nem:=' world.save.new';
reset (w);
assignfile (e,nem);
rewrite (e);
for lb1 := 0 to (listbox1.Items.Count - 1) do
tsie:=listbox1.Items.Strings[lb1];
tsie:=tsie+' ';
assignfile (t,' temp\Temp.shad') ;
rewrite (t);
repeat
readln (w,line);
until line=' [OBJECT]';
writeln (t,' [OBJECT]');
repeat
repeat
readln (w,line);
writeln (t,line);
z:=z+1;
until line=' ';
reset (t);
tsn:=0;
repeat
readln(t,line);
if pos(tsie,line) <> 0 then tsn:= tsn + 1;
until eof(t);
if tsn=0 then begin
reset (t);
repeat
readln(t,line);
writeln (e,line);
until eof (t) ;
closefile (t);
rewrite (t);
end
else
closefile (t);
rewrite (t);
until eof (w)=true;
closefile (w);
deletefile (' world.save');
world:=false;
closefile(e);
assignfile (e,' world.save.new');
reset (e);
ot:=true;
if ot=true and (world=false) then
nem:=' ' ;
world:=true;
assignfile (w,nem);
assignfile (w,' save\world.save');
reset (w);
assignfile (o,' world.save') ; ///////// ab hier scheppert es immer/////
rewrite (w);
repeat
readln (e,line);
writeln (o,line);
until eof (e);
reset (e);
closefile (w);
closefile (o);
closefile(e);
closefile (t);
ot:=true;
if ot=true then
nem:=' ' ;
assignfile (e,nem);
tsie:=' ';
deletefile (' temp\Temp.shad');
lcou:=lb2-1;
listbox1.Items.Delete(lcou);
listbox2.Items.Delete(lcou);
lb2:=lb2-1;
label8.Caption:=inttostr(lb2);
ot:=false;
showmessage (' noch '+inttostr(lb2)+' Durchläufe');
until listbox1.Items.Count =0;
assignfile(w,' world.save');
reset (w);
tota:=0;
repeat
readln (w,line);
if line = ' [OBJECT]' then
tota:=tota+1;
until eof (w);
label4.Caption:= inttostr (tota);
assignfile (e,' world.save.new');
reset(W);
reset (e);
assignfile (c,' world.save.bk') ;
reset (c);
repeat
readln (c,line);
writeln (e,line);
until line=' [OBJECTS]';
closefile (c);
writeln (e,' total='+inttostr(tota));
writeln (e,' ');
repeat
readln (w,line);
writeln (e,line);
until eof (w);
closefile (w);
deletefile (' world.save');
closefile(e);
assignfile (e,' world.save.new');
reset (e);
assignfile (w,' world.save');
reset (w);
repeat
readln (e,line);
writeln (w,line);
until eof (e);
reset (e);
closefile (w);
closefile(e);
showmessage (' Fergig');
end;
hoffe ihr könnt mir Helfen
Mfg Devilone
[edit=Sharky]Abschliessenden Delphi-Tag korrigiert. Mfg, Sharky[/edit]
|