Language:
Русский
English
BlockRead (procedure)
Reads one or more records into a variable.
Declaration
procedure BlockRead(var F: File; var Buf; Count: Word [; var Result
Word]);
where:
F untyped file variable
Buf any variable
Count an expression of type Word
Result a variable of type Word
Target
Windows, Real, Protected
Remarks
F is an untyped file variable, Buf is any variable, Count is an expression of type Word, and Result is a variable of type Word.
BlockRead reads Count or fewer records from the file F into memory, starting at the first byte occupied by Buf. The actual number of complete records read (less than or equal to Count) is returned in the optional parameter Result. If Result is not specified, an I/O error occurs if the number read is not equal to Count.
The entire transferred block occupies at most Count symbol * RecSize bytes, where RecSize is the record size specified when the file was opened (or 128 if the record size was not specified). An error occurs if Count symbol * RecSize is greater than 65,535 (64K).
Result is an optional parameter. If the entire block was transferred, Result will be equal to Count on return. Otherwise, if Result is less than Count, the end of the file was reached before the transfer was completed. In that case, if the file's record size is greater than 1, Result returns the number of complete records read.
The current file position is advanced by Result records as an effect of BlockRead.
With {$I-}, IOResult returns 0 if the operation succeeded; otherwise, it returns a nonzero error code.
Restrictions
File must be open.