previous next top contents index framed top this page unframed
Figure 44–2. $pageRead
| LONG INTEGER PROCEDURE $pageRead (POINTER(dataFile) f; ADDRESS memAdr; LONG INTEGER startPage; OPTIONAL LONG INTEGER numPages; OPTIONAL BITS ctrlBits); |
$pageRead reads numPages pages of data from f to the ADDRESS memAdr, starting at page startPage in the file (the first page is numbered zero). A page is $pageSize storage units. If numPages is less than or equal to zero, one page is read.
Unless f is opened for random access, $pageRead succeeds only if the file is positioned at the start of the page to be read; otherwise, an error message is given.
The only valid ctrlBits bit is errorOK. If not set, an error occurs if $pageRead cannot read the amount of data requested. The value returned by $pageRead is the number of character units read from f.
$pageRead may be especially efficient if the file was opened with the $unbuffered bit.
$storageUnitRead and $characterRead are other PROCEDUREs used to read large amounts of data from a file with a single PROCEDURE call.
$pageRead does not modify or translate data from files opened for PDF I/O, since it has no way to know the data type(s) of the data read.
MAINSAIL Language Manual, Section 44.2