AEGetArray
You can use theAEGetArray
function to convert an Apple event array (an array created with theAEPutArray
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 typekAEDataArray
,kAEPackedArray
, orkAEHandleArray
, 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
, orkAEKeyDescArray
.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
, orkAEHandleArray
, theAEGetArray
function returns the descriptor type of the returned array items in this parameter.itemSize
- For arrays of type
kAEDataArray
orkAEPackedArray
, theAEGetArray
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
TheAEGetArray
function uses a buffer identified by the pointer in thearrayPtr
parameter to return the converted data for the Apple event array specified by thetheAEDescList
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 callAEGetArray
.RESULT CODES
noErr 0 No error memFullErr -108 Not enough room in heap zone errAEWrongDataType -1703 Wrong descriptor type errAENotAEDesc -1704 Not a valid descriptor record errAEReplyNotArrived -1718 Reply has not yet arrived SEE ALSO
For more information about data types and constants used withAEGetArray
, 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 ofAEPutArray
on page 5-32.