Important: The information in this document is obsolete and should not be used for new development.
ReadEdition
Use theReadEditionfunction to read data from an edition. This function reads from the current mark for the specified format.
FUNCTION ReadEdition (whichEdition: EditionRefNum; whichFormat: FormatType; buffPtr: UNIV Ptr; VAR buffLen: Size): OSErr;
whichEdition- The reference number for the edition.
whichFormat- The format type that you want to read.
buffPtr- A pointer to the buffer into which you want to read the data.
buffLen- The number of bytes that you want to read into the buffer. The
ReadEditionfunction returns the actual number of bytes read in thebuffLenparameter.DESCRIPTION
TheReadEditionfunction reads data from the edition into the specified buffer.ReadEditionreturns in thebuffLenparameter the total number of bytes read into the buffer. If thebuffLenparameter returns a value smaller than the value you have specified, there is no additional data to read, and theReadEditionfunction returns anoErrresult code. If you use theReadEditionfunction after all data is read in, theReadEditionfunction returns aneofErrresult code.You can read data from an edition while a publisher on the same machine is writing data to the same edition. The data that you are reading is the old edition (not the data that the publisher is writing). If the publisher finishes writing data before you are through reading the old edition data, the
ReadEditionfunction returns anabortErrresult code. If theReadEditionfunction returns anabortErrresult code, you should stop trying to read data and use theCloseEditionfunction with thesuccessfulparameter set toFALSE.
- Note
- The Translation Manager (if it is available) attempts implicit translation under certain circumstances. For instance, it does so when your application attempts to read from an edition a format type that is not in the edition. In this case, the Translation Manager attempts to translate the data into the requested format. For more information, see the chapter "Translation Manager" in Inside Macintosh: More Macintosh Toolbox.
![]()
RESULT CODES
noErr 0 No error abortErr -27 Publisher has written a new edition ioErr -36 I/O error fnOpnErr -38 File not open eofErr -39 No more data of that format rfNumErr -51 Bad edition reference number noTypeErr -102 Format not available editionMgrInitErr -450 Manager not initialized SEE ALSO
For an example of the use ofReadEdition, see Listing 2-7 beginning on page 2-42.