Preben Mikael Bohn preben at chin.dk
Wed Mar 19 18:29:07 CET 2003

 Anton Tichawa wrote:
> Please post the data declarations (e. g. var Count: Integer; const
> MAX_BUFFER_SIZE = .. etc.). Normally, an index starts from 0 upwards, e. g.
> if you had:

It starts at 1, but that really shouldn't matter that much.

If you really want the other stuff I can give you what I have now, but that is
not really readable :-) :

  if startBufferIndex < realFileSize then
    seek(dataFile, startBufferIndex);
    err := IOResult;
    { xxx error check here deleted }
    count := min(endBufferIndex, realFileSize - 1) - startBufferIndex + 1;

    blockread(dataFile, fabuffer, count);
    err := IOResult;
    { xxx error check here deleted }

As you can see I simply assume that everything is read in to the buffer and I
also know that the remaining file is larger than or equal to the count.

Best regards Preben

More information about the fpc-pascal mailing list