Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.01.08;
Скачать: CL | DM;

Вниз

код не создает более `273 files in win2000   Найти похожие ветки 

 
Dmitriy(new)   (2001-12-13 19:37) [0]

код не создает более `273 files in win2000

procedure TForm1.Button1Click(Sender: TObject);
var SearchRec:Tsearchrec; f:file; b:array[0..16383]of byte; S,shortname,FileName:string; I,ExtNum,size :integer;
begin
// Create the Archive directory (if its not there)
FileName:="RAMIZ.RCV"; GlobalStop:=False;
{$i-}// chdir (".."); createdir ("R"); chdir (".."); {$i+}
// read the file
For I:=1 To 50000 Do Begin
If GlobalStop Then Break;
Label1.Caption:=inttostr(i); Application.ProcessMessages;
assignfile (f,FileName); reset (f,1); blockread (f,b,16384,size); closefile (f); //erase (f);
ExtNum:=1000; ShortName:="..\r\RAMIZ";
repeat
inc (ExtNum); S:= shortname+inttostr (ExtNum)+".RCV";
until findfirst (S,$3f,SearchRec)<>0;
assignfile (f,S);
rewrite (f,1);
blockwrite (f,b,size);
closefile (f);
end;
end;


 
Dmitriy(new)   (2001-12-13 20:23) [1]

и что не кто не можем понять


 
Dmitriy(new)   (2001-12-13 20:40) [2]

HELP !!!!


 
Макс Черных ©   (2001-12-13 22:47) [3]

1. чудесатый код какой-то.
2. Что сразу в глаза бросается:

repeat
inc (ExtNum); S:= shortname+inttostr (ExtNum)+".RCV";
until findfirst (S,$3f,SearchRec)<>0; //<<<<-----
assignfile (f,S);

Каждому вызову findfirst должен соответствовать вызов FindClose,
а иначе можно очень быстро систему без ресурсов оставить.
См. help раздел: "FindFirst function"





 
Ю.Ю.   (2001-12-14 06:52) [4]

Зачем 50000 раз считывать один и тот-же файл "RAMIZ.RCV"?
Зачем искать файл, если вызвыается Rewrite ?
Rewrite creates a new external file with the name assigned to F.
If an external file with the same name already exists, it is deleted and a new empty file is created in its place.


 
Dmitriy(new)   (2001-12-16 09:38) [5]

> Макс Черных ©

спасибо

я думал что в Win 2000 глючит код
assignfile (f,FileName); reset (f,1); blockread (f,b,16384,size); closefile (f);

> Ю.Ю.

пример тестовый



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

Текущий архив: 2002.01.08;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.01 c
1-22250
Дмитрий Д.
2001-12-17 13:28
2002.01.08
Скорее математический вопрос...


14-22318
frostbite
2001-10-31 17:11
2002.01.08
Rewind


1-22148
Delphimun
2001-12-20 12:10
2002.01.08
Как послать системе сообщение, что нажата клавиша?


14-22345
petr_v_a
2001-11-05 20:13
2002.01.08
В защиту Ланы Розановой &Co!!!


1-22172
ASTARD
2001-12-19 22:12
2002.01.08
Народ помогите плиз ???