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.56 MB
Time: 0.035 c
7-22442
Alexei
2001-09-26 15:20
2002.01.08
How to determine the presence of a modem?


7-22426
inferno123
2001-09-25 10:32
2002.01.08
Port programming


1-22002
BFG
2001-12-16 16:24
2002.01.08
Graphs


3-21966
Z.G.
2001-12-03 12:42
2002.01.08
WHY THAT DID ALL MY QUESTIONS. We'll have to repeat How to search the Type in the field: Ceilings are written and I need to find


1-22081
Andrewv
2001-12-18 14:14
2002.01.08
How to cause a system error.





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 Spanish 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