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 4 - Responding to Apple Events / Reference to Responding to Apple Events
Routines for Responding to Apple Events / Coercing Descriptor Types


AECoerceDesc

You can use the AECoerceDesc function to coerce the data in a descriptor record to another descriptor type.

FUNCTION AECoerceDesc (theAEDesc: AEDesc; toType: DescType; 
                       VAR result: AEDesc): OSErr;
theAEDesc
The descriptor record whose data is to be coerced.
toType
The desired descriptor type of the resulting descriptor record.
result
The resulting descriptor record.
DESCRIPTION
The AECoerceDesc function attempts to create a new descriptor record by coercing the specified descriptor record. Your application is responsible for using the AEDisposeDesc function to dispose of the resulting descriptor record once you are finished using it.

If AECoerceDesc returns a nonzero result code, it returns a null descriptor record (a descriptor record of type typeNull, which does not contain any data) unless the Apple Event Manager is not available because of limited memory.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
errAECoercionFail-1700Data could not be coerced to requested descriptor type
SEE ALSO
For a list of the descriptor types for which the Apple Event Manager provides coercions, see Table 4-1, which begins on page 4-45.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996