Important: The information in this document is obsolete and should not be used for new development.
Apple Event Array Data Types
TheAEGetArray
function (see page 4-77) creates a Pascal or C array that corresponds to an Apple event array in a descriptor list, and theAEPutArray
function (see page 5-32) adds data specified in a buffer to a descriptor list as an Apple event array.You can use the data type
AEArrayType
to define the type of Apple event array you want to add to or obtain from a descriptor list.
TYPE AEArrayType = (kAEDataArray, kAEPackedArray, kAEHandleArray, kAEDescArray, kAEKeyDescArray);When your application adds an Apple event array to a descriptor list, it provides the data for an Apple event array in an array data record, which is defined by the data typeAEArrayData
.
TYPE AEArrayData = RECORD {data for an Apple event array} CASE AEArrayType OF kAEDataArray: (AEDataArray: ARRAY[0..0] OF Integer); kAEPackedArray: (AEPackedArray: PACKED ARRAY[0..0] OF Char); kAEHandleArray: (AEHandleArray: ARRAY[0..0] OF Handle); kAEDescArray: (AEDescArray: ARRAY[0..0] OF AEDesc); kAEKeyDescArray: (AEKeyDescArray: ARRAY[0..0] OF AEKeyDesc); END;The type of array depends on the data for the array:
Array type Description of Apple event array kAEDataArray Array items consist of data of the same size and same type, and are aligned on word boundaries. kAEPackedArray Array items consist of data of the same size and same type, and are packed without regard for word boundaries. kAEHandleArray Array items consist of handles to data of variable size and the same type. kAEDescArray Array items consist of descriptor records of different descriptor types with data of variable size. kAEKeyDescArray Array items consist of keyword-specified descriptor records with different keywords, different descriptor types, and data of variable size. Array items in Apple event arrays of type
kAEDataArray
,kAEPackedArray
, orkAEHandleArray
must be factored--that is, contained in a factored descriptor list. Before adding array items to a factored descriptor list, you should provide both a pointer to the data that is common to all array items and the size of that common data when you first callAECreateList
to create a factored descriptor list. When you callAEPutArray
to add the array data to such a descriptor list, the Apple Event Manager automatically isolates the common data you specified in the call toAECreateList
.When you call
AEGetArray
orAEPutArray
, you specify a pointer of data typeAEArrayDataPointer
that points to a buffer containing the data for the array.
TYPE AEArrayDataPointer = ^AEArrayData;For more information about usingAECreateList
to create factored descriptor lists for arrays, see page 5-29. For information about usingAEGetArray
andAEPutArray
, see page 4-77 and page 5-32, respectively.