Forum: Object-Pascal / Delphi-Language
Delphi
by FredlFesl,
10. Mai 2011
No. It writes the whole file. Notice the "REPEAT UNTIL" loop. It reads 1MB data from the source and appends it to the file. Then in reads the next 1MB.... until there is no more data in the source.
Forum: Object-Pascal / Delphi-Language
Delphi
by FredlFesl,
9. Mai 2011
The Code contains errors and redundant stuff.
Here's my improved / modified and untested version.
Const
BLOCKSIZE = 1024*1024; // Write in chunks @ 1MB
function AddData(ID:string; pBuf: Pointer; Count: Integer): Integer;
begin
FFile.Seek(0, soFromEnd);
if( Result > -1 )then // ***** WHERE DOES THIS Result COME FROM? if you leave it Like this, it will not work.