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.82 MB
Time: 0.067 c
3-21915
KAA
2001-12-04 10:28
2002.01.08
Resetting the MSSQL2000 variable


3-21901
Victor
2001-12-06 09:46
2002.01.08
problem with deleting records


4-22476
kingdom
2001-11-02 19:42
2002.01.08
Help, UpdateResource does not work with BPL files!


1-22193
T2
2001-12-14 03:17
2002.01.08
DLL


7-22448
Stanislas
2001-09-11 15:24
2002.01.08
Data on diskette





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