Главная страница
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.016 c
3-21936
vvs
2001-12-05 06:42
2002.01.08
Delphi5+SQL Server7 нормально, а Delphi5+SQL 2000 бред


7-22450
fsp
2001-09-21 22:32
2002.01.08
СВоарчивание проги в систем трей.


7-22420
Cntcyz.cm crfpfnm cdjt bvz
2001-09-21 21:12
2002.01.08
Народ подскажите как мне быть ?


14-22362
MIFI
2001-11-04 02:34
2002.01.08
как найти человека


1-22083
DeNNiss
2001-12-19 12:06
2002.01.08
Помогите пожалуйста!