Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

the code does not create more `273 files in win2000 Find similar branches


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]

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

thank you

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

> Ю.Ю.

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



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top















Memory: 0.83 MB
Time: 0.059 c
1-22131
Kate
2001-12-20 08:27
2002.01.08
I really need


3-21915
KAA
2001-12-04 10:28
2002.01.08
Resetting the MSSQL2000 variable


3-21943
Oleon
2001-12-05 10:54
2002.01.08
How to use TableLevel?


1-22104
Derzky
2001-12-18 19:54
2002.01.08
How to compare dates.


1-22110
Katherine
2001-12-19 18:09
2002.01.08
tearfully ask for help





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish