Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 4 - Responding to Apple Events / Reference to Responding to Apple Events
Routines for Responding to Apple Events / Getting Items From Descriptor Lists


AEGetArray

You can use the AEGetArray function to convert an Apple event array (an array created with the AEPutArray function and stored in a descriptor list) to the corresponding Pascal or C array and place the converted array in a buffer for which you have provided a pointer.

FUNCTION AEGetArray (theAEDescList: AEDescList; 
                     arrayType: AEArrayType; 
                     arrayPtr: AEArrayDataPointer; 
                     maximumSize: Size; 
                     VAR itemType: DescType; VAR itemSize: Size; 
                     VAR itemCount: LongInt): OSErr;
theAEDescList

A descriptor list containing the desired array. If the array is of type kAEDataArray, kAEPackedArray, or kAEHandleArray, the descriptor list must be factored.
arrayType
The Apple event array type to be converted. This is specified by one of the following constants: kAEDataArray, kAEPackedArray, kAEHandleArray, kAEDescArray, or kAEKeyDescArray.
arrayPtr
A pointer to the buffer for storing the array.
maximumSize

The maximum length, in bytes, of the buffer for storing the array.
itemType
For arrays of type kAEDataArray, kAEPackedArray, or kAEHandleArray, the AEGetArray function returns the descriptor type of the returned array items in this parameter.
itemSize
For arrays of type kAEDataArray or kAEPackedArray, the AEGetArray function returns the size (in bytes) of the returned array items in this parameter.
itemCount
The AEGetArray function returns the number of items in the resulting array in this parameter.
DESCRIPTION
The AEGetArray function uses a buffer identified by the pointer in the arrayPtr parameter to return the converted data for the Apple event array specified by the theAEDescList parameter. Even if the descriptor list that contains the array is factored, the converted data for each array item includes the data common to all the descriptor records in the list. The Apple Event Manager automatically reconstructs the common data for each item when you call AEGetArray.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
errAEWrongDataType-1703Wrong descriptor type
errAENotAEDesc-1704Not a valid descriptor record
errAEReplyNotArrived-1718Reply has not yet arrived
SEE ALSO
For more information about data types and constants used with AEGetArray, see "Apple Event Array Data Types" on page 4-60.

For information about creating and factoring descriptor lists for Apple event arrays, see the description of AECreateList on page 5-29. For information about adding an Apple event array to a descriptor list, see the description of AEPutArray on page 5-32.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996