Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 2 - Edition Manager / Edition Manager Reference
Edition Manager Routines / Reading in Edition Data


EditionHasFormat

Use the EditionHasFormat 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 the kFormatListFormat ('fmts') format.
formatSize
The EditionHasFormat function returns the format length in this parameter.
DESCRIPTION
If the requested format is available, the EditionHasFormat function returns noErr, and the formatSize parameter returns the size of the data in the specified format or kFormatLengthUnknown (-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
noErr0No error
rfNumErr-51Bad edition reference number
noTypeErr-102Format not available
editionMgrInitErr-450Manager not initialized
SEE ALSO
For an example of the use of EditionHasFormat, see Listing 2-7 beginning on page 2-42. For information about the Translation Manager and Scrap Manager, see Inside Macintosh: More Macintosh Toolbox.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996