Important: The information in this document is obsolete and should not be used for new development.
MyCompareObjects
If you want the Apple Event Manager to help your application resolve object specifier records of key formformTest
(and if your application doesn't specifykAEIDoWhose
as described on page 6-56), you should provide an object-counting function and an object-comparison function. After comparing one Apple event object to another or to the data for a descriptor record, an object-comparison function should returnTRUE
orFALSE
in theresult
parameter.
FUNCTION MyCompareObjects (comparisonOperator: DescType; object: AEDesc; objectOrDescToCompare: AEDesc; VAR result: Boolean): OSErr;
comparisonOperator
- The comparison operator. See the description of
CreateCompDescriptor
on page 6-102 for standard comparison operators at the time of publication of this book. The current version of the Apple Event Registry: Standard Suites lists all the constants for comparison operators.object
- A token.
objectOrDescToCompare
- A token or some other descriptor record that specifies either an Apple event object or a value to compare to the Apple event object specified by the
object
parameter.result
- Your object-comparison function should return, in this parameter, a Boolean value that indicates whether the values of the
object
andobjectOrDescToCompare
parameters have the relationship specified by thecomparisonOperator
parameter (TRUE
) or not (FALSE
).DESCRIPTION
The Apple Event Manager calls your object-comparison function when, in the course of resolving an object specifier record, the manager needs to compare an Apple event object with another or with a value.It is up to your application to interpret the comparison operators it receives. The meaning of comparison operators differs according to the Apple event objects being compared, and not all comparison operators apply to all object classes.
SPECIAL CONSIDERATIONS
If the Apple Event Manager receives the result code errAEEventNotHandled after calling an object-comparison function, it attempts to use other methods of comparison, such as calling an equivalent system object-comparison function. Thus, an object-comparison function that can't perform a requested comparison should return errAEEventNotHandled. This allows the Apple Event Manager to try other object-comparison functions that may be available.RESULT CODES
noErr 0 No error occurred errAEEventNotHandled -1708 The object-comparison function is unable to compare the specified Apple event objects SEE ALSO
For more information, see "Writing an Object-Comparison Function" on page 6-58.