Built-in Coercion Handlers
Built-in Coercion Handlers
The following is a table describing the various coercions that the
Apple Event Manager can perform. The Desired descriptor type is
the value that you would pass to an Apple Event Manager routine that
accepts a coercion type, such as AEGetParamPtr, AEGetAttributePtr,
AEGetParamDesc, AEGetAttributeDesc, AEGetNthPtr,
AEGetNthDesc, AEGetArray, AEGetKeyPtr, or AEGetKeyDesc.
Original Desired
descriptor type descriptor type Description
typeChar typeInteger Any string that is a valid
typeLongInteger representation of a number
typeSMInt can be coerced into an
typeSMFloat equivalent numeric value.
typeShortInteger
typeLongFloat
typeShortFloat
typeExtended
typeComp
typeMagnitude
typeInteger typeChar Any numeric descriptor type
typeLongInteger [TOKEN:25441]n be coerced into
typeSMInt [TOKEN:29800]e equivalent text string.
typeSMFloat
typeShortInteger
typeLongFloat
typeShortFloat
typeExtended
typeComp
typeMagnitude
typeInteger typeInteger Any numeric descriptor type
typeLongInteger typeLongInteger can be coerced into any other
typeSMInt typeSMInt numeric descriptor type.
typeSMFloat typeSMFloat
typeShortInteger typeShortInteger
typeLongFloat typeLongFloat
typeShortFloat typeShortFloat
typeExtended typeExtended
typeComp typeComp
typeMagnitude typeMagnitude
typeTrue typeBoolean The result is TRUE.
typeFalse typeBoolean The result is FALSE.
typeEnumerated typeBoolean The enumerated value 'true'
becomes the Boolean value
TRUE. The enumerated value
'fals' becomes the Boolean
value FALSE.
typeBoolean typeEnumerated The Boolean value FALSE
becomes the enumerated
value 'fals'. The Boolean
value TRUE becomes the
enumerated value 'true'.
typeShortInteger typeBoolean A value of 1 becomes the
Boolean value TRUE. A value
of 0 becomes the Boolean
value FALSE.
typeBoolean typeShortInteger A value of FALSE becomes 0.
a value of TRUE becomes 1.
typeAlias typeFSS An alias record is coerced
into a file system
specification record.
typeAppleEvent typeAppParameters An Apple event is coerced into
a list of application
parameters for the
parameter block.
any descriptor type typeAEList A descriptor record is
coerced into a descriptor
list with a single item.
typeAEList type of list item A descriptor list containing
a single descriptor record is
coerced into a descriptor
record.