• Reference Guide


read_block(f, size)
read_block(f, size, var_rd)
The parameter f is a variable of the type File. The file must be open for reading. The function reads a block of bytes of the size specified by the size parameter (of the type Int) and moves the file pointer forward by the number of bytes read. The data read is returned as a value of the Binary type. If the parameter var_rd is specified, it must be a variable of the type Int. The function stores to this variable the real number of bytes that have been read. If zero bytes are read, it indicates that the end of file was reached. If the var_rd parameter is not specified and there is not sufficient amount of data in the file, an error is returned. Even in that case, the file pointer is moved forward to the end of file.
If an error occurs, an Error value is returned.
Specifying a negative size is an error.

See Also