previous next top contents index framed top this page unframed
Figure 47–40. $storageUnitWrite
| PROCEDURE $storageUnitWrite (POINTER(dataFile) f; LONG INTEGER numStorageUnits; POINTER ptrBase; OPTIONAL LONG INTEGER dspl; OPTIONAL ADDRESS adrBase); |
$storageUnitWrite writes numStorageUnits storage units of data to the data file f from an ADDRESS computed as displace(IF adrBase THEN adrBase EL cva(ptrBase),dspl). An error occurs if both adrBase and ptrBase are Zero.
If adrBase is non-Zero, the effect is undefined if displace(adrBase,dspl) does not lie within a region of scratch space obtained with newScratch, $newScratchChars, or newPage or if the region does not contain at least numStorageUnits of space beyond the computed ADDRESS. If adrBase is Zero, the effect is undefined if ptrBase does not point to a valid MAINSAIL dynamic object or if the object is smaller than dspl + numStorageUnits storage units.
For large amounts of data, $storageUnitWrite is more efficient than a series of calls to the PROCEDURE write.
$pageWrite and $characterWrite are other PROCEDUREs used to write large amounts of data to a file with a single PROCEDURE call.
$storageUnitWrite 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 written.
MAINSAIL Language Manual, Section 47.48