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 6 - Resolving and Creating Object Specifier Records / Reference to Resolving and Creating Object Specifier Records
Routines for Resolving and Creating Object Specifier Records / Creating Object Specifier Records


CreateCompDescriptor

You can use the CreateCompDescriptor function to create a comparison descriptor record.

FUNCTION CreateCompDescriptor (comparisonOperator: DescType;
                               VAR operand1: AEDesc; 
                               VAR operand2: AEDesc; 
                               disposeInputs: Boolean; 
                               VAR theDescriptor: AEDesc)
                               : OSErr;
comparisonOperator
The comparison operator for comparing the descriptor records in the operand1 and operand2 parameters. The operator is specified by the constants listed in the description that follows.
operand1
An object specifier record.
operand2
A descriptor record (which can be an object specifier record or any other descriptor record) whose value is to be compared to the value of operand1.
disposeInputs
A Boolean value indicating whether the function (TRUE) or your application (FALSE) should dispose of the descriptor records for the two operands.
theDescriptor
The comparison descriptor record created by CreateCompDescriptor.
DESCRIPTION
The CreateCompDescriptor function creates a comparison descriptor record, which specifies how to compare one or more Apple event objects with either another Apple event object or a descriptor record.

The actual comparison of the two operands is performed by the object-comparison function provided by the client application. The way a comparison operator is interpreted is up to each application.

These are the currently defined standard comparison operators:
ConstantMeaning
kAEGreaterThanThe value of operand1 is greater than the value of operand2.
kAEGreaterThanEqualsThe value of operand1 is greater than or equal to the value of operand2.
kAEEqualsThe value of operand1 is equal to the value of operand2.
kAELessThanThe value of operand1 is less than the value of operand2.
kAELessThanEqualsThe value of operand1 is less than or equal to the value of operand2.
kAEBeginsWithThe value of operand1 begins with the value of operand2 (for example, the string "operand" begins with the string "opera").
kAEEndsWithThe value of operand1 ends with the value of operand2 (for example, the string "operand" ends with the string "and").
kAEContainsThe value of operand1 contains the value of operand2 (for example, the string "operand" contains the string "era").

RESULT CODES
noErr0No error occurred
paramErr-50Error in parameter list
memFullErr-108Not enough room in heap zone
errAECoercionFail -1700Data could not be coerced to the requested Apple event data type
errAEWrongDataType-1703Wrong Apple event data type
errAENotAEDesc-1704Not a valid descriptor record
errAEBadListItem-1705Operation involving a list item failed
SEE ALSO
For an example of how to use the CreateCompDescriptor function to create a comparison descriptor record, see "Specifying a Test," which begins on page 6-75.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996