Carbon


AECoercePtr

Header: AEDataModel.h Carbon status: Supported

Coerces data to a desired descriptor type and creates a descriptor record containing the newly coerced data.

OSErr AECoercePtr (
    DescType typeCode, 
    const void *dataPtr, 
    Size dataSize, 
    DescType toType, 
    AEDesc *result
);
Parameter descriptions
typeCode

The descriptor type of the source data. For a list of AppleScript’s predefined descriptor types, see “Descriptor Type Constants”.

dataPtr

A pointer to the data to coerce.

dataSize

The length, in bytes, of the data to coerce.

toType

The desired descriptor type of the resulting descriptor record. For a list of AppleScript’s predefined descriptor types, see “Descriptor Type Constants”.

result

A pointer to a descriptor record. On successful return, a descriptor containing the coerced data and matching the descriptor type specified in toType. On error, a null descriptor. Your application should always call the AEDisposeDesc function to dispose of the resulting descriptor record after it has finished using it.

function result

A result code.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)