Important: The information in this document is obsolete and should not be used for new development.
CreateCompDescriptor
You can use theCreateCompDescriptor
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
andoperand2
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
TheCreateCompDescriptor
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:
Constant Meaning kAEGreaterThan The value of operand1
is greater than the value ofoperand2
.kAEGreaterThanEquals The value of operand1
is greater than or equal to the value ofoperand2
.kAEEquals The value of operand1
is equal to the value ofoperand2
.kAELessThan The value of operand1
is less than the value ofoperand2
.kAELessThanEquals The value of operand1
is less than or equal to the value ofoperand2
.kAEBeginsWith The value of operand1
begins with the value ofoperand2
(for example, the string"operand"
begins with the string"opera"
).kAEEndsWith The value of operand1
ends with the value ofoperand2
(for example, the string"operand"
ends with the string"and"
).kAEContains The value of operand1
contains the value ofoperand2
(for example, the string"operand"
contains the string"era"
).RESULT CODES
noErr 0 No error occurred paramErr -50 Error in parameter list memFullErr -108 Not enough room in heap zone errAECoercionFail -1700 Data could not be coerced to the requested Apple event data type errAEWrongDataType -1703 Wrong Apple event data type errAENotAEDesc -1704 Not a valid descriptor record errAEBadListItem -1705 Operation involving a list item failed SEE ALSO
For an example of how to use theCreateCompDescriptor
function to create a comparison descriptor record, see "Specifying a Test," which begins on page 6-75.