Important: The information in this document is obsolete and should not be used for new development.
EditionHasFormat
Use theEditionHasFormat
function to learn in which formats the edition data is available.
FUNCTION EditionHasFormat (whichEdition: EditionRefNum; whichFormat: FormatType; VAR formatSize: Size): OSErr;
whichEdition
- The reference number for the edition.
whichFormat
- The format type that you are requesting. For the
whichFormat
parameter, you should decide which formats to read in the same way that you do when reading data from the scrap. You can also get a list of all the available formats and their respective lengths by reading thekFormatListFormat
('fmts'
) format.formatSize
- The
EditionHasFormat
function returns the format length in this parameter.DESCRIPTION
If the requested format is available, theEditionHasFormat
function returnsnoErr
, and theformatSize
parameter returns the size of the data in the specified format orkFormatLengthUnknown
(-1), which signifies that the size is unknown. You should therefore continue to read the format until there is no more data.
- 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 rfNumErr -51 Bad edition reference number noTypeErr -102 Format not available editionMgrInitErr -450 Manager not initialized SEE ALSO
For an example of the use ofEditionHasFormat
, see Listing 2-7 beginning on page 2-42. For information about the Translation Manager and Scrap Manager, see Inside Macintosh: More Macintosh Toolbox.