Вниз
Скачать: CL | DM;

I/o error   Найти похожие ветки 

← →
Goldseeker   (2005-01-03 18:51) [0]

почему может не работать такой код:

procedure TForm1.Button2Click(Sender: TObject);
begin
AssignFile(F,path+"index.txt");
Rewrite(f);
writeln(F, inttostr(length(armys)));
for i := 0 to length(armys)-1 do
begin
writeln(f,armys[i].name);
end;
closefile(f);
for i:=0 to length(armys)-1 do
begin
assignfile(f,path + armys[i].Name +".txt"); // M,WS,S,BS,T,W,I,A,Ld: integer ;
writeln(f,inttostr(armys[i].M));
writeln(f,inttostr(armys[i].ws));
writeln(f,inttostr(armys[i].s));
writeln(f,inttostr(armys[i].bs));
writeln(f,inttostr(armys[i].t));
writeln(f,inttostr(armys[i].w));
writeln(f,inttostr(armys[i].i));
writeln(f,inttostr(armys[i].a));
writeln(f,inttostr(armys[i].ld));
closefile(f);
end;
for i:=0 to length(armys)-1 do
begin
assignfile(f,path + armys[i].Name +".mem"); // M,WS,S,BS,T,W,I,A,Ld: integer ;
writeln(f,armys[i].note);
Close;
end;
end;

выдает ошибку 103, причем
вот этот код в отдельности работае нормально

procedure TForm1.Button2Click(Sender: TObject);
begin
AssignFile(F,path+"index.txt");
Rewrite(f);
writeln(F, inttostr(length(armys)));
for i := 0 to length(armys)-1 do
begin
writeln(f,armys[i].name);
end;
closefile(f);


← →
GanibalLector ©   (2005-01-03 18:58) [1]

Rewrite(f); забыл во втором и третьем случаи
closefile(f); забыл в третьем случаи


← →
GanibalLector ©   (2005-01-03 19:00) [2]

Вроде так :

for i:=0 to length(armys)-1 do
begin
assignfile(f,path + armys[i].Name +".txt"); // M,WS,S,BS,T,W,I,A,Ld: integer ;
Rewrite(f);
writeln(f,inttostr(armys[i].M));
writeln(f,inttostr(armys[i].ws));
...
begin
assignfile(f,path + armys[i].Name +".mem"); // M,WS,S,BS,T,W,I,A,Ld: integer ;
Rewrite(f);
writeln(f,armys[i].note);
//Close;
closefile(f);
end;


← →
Goldseeker   (2005-01-03 19:25) [3]

Спасибо!!
з.ы.невнимательность хуже глупости..



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.024 c
1-1104240403
Илья
2004-12-28 16:26
2005.01.16
D5 запускается без главного окна.


14-1103936717
Германн
2004-12-25 04:05
2005.01.16
Количество TImage


4-1101715712
zetovich
2004-11-29 11:08
2005.01.16
Сделать недоступным "Панель задач", "кн Пуск"


3-1103028188
alex145
2004-12-14 15:43
2005.01.16
Показывается только две колонки


9-1096483582
Jus
2004-09-29 22:46
2005.01.16
Как избежать ошибки <B>Canvas does not allow drawing </B>при свор




   Наверх