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]

the code does not create more `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 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, xnumx, 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]

and that no one can understand



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

HELP !!!!



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

1. Wonderful code of some kind.
2. What immediately catches the eye:
repeat inc (ExtNum); S: = shortname + inttostr (ExtNum) + ". RCV"; until findfirst (S, $ 3f, SearchRec) <> 0; // <<<< ----- assignfile (f, s);
Each findfirst call must have a FindClose call,
otherwise you can very quickly leave the system without resources.
See the help section: "FindFirst function"






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

Why does 50000 read the same file "RAMIZ.RCV" once?
Why search for a file if Rewrite is called?
The rewrite is assigned to F.
It has been created in its place.



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

> Max Black ©

thank you

I thought that in Win 2000 the code is buggy
assignfile (f, FileName); reset (f, 1); blockread (f, b, xnumx, size); closefile (f);

> Yu.Yu.

example test



Pages: 1 whole branch

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

Top









Memory: 0.57 MB
Time: 0.043 c
1-22222
Eugene Zelikovsky
2001-12-14 13:58
2002.01.08
Callback


1-22093
Bristol
2001-12-19 11:59
2002.01.08
sending letters using Delphi 5


1-22100
Avol
2001-12-15 18:29
2002.01.08
How in Delphi to make a table of records for the game?


14-22382
Panov
2001-11-08 18:54
2002.01.08
continuation http://delphi.mastak.ru/cgi-bin/forum.pl?look=1&id=1005233643&n=3


3-21984
Mr. Andrew
2001-12-05 20:39
2002.01.08
Data update





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