version 2003
PA_SetPictureHandleInArray (array; index; newPictHandle)
Parameter | Type | Description | |
array | PA_Variable | Array to access | |
index | long | Index of the element to access | |
newPictHandle | PA_Handle | New value of the handle of the index element |
Description
The routine PA_SetPictureHandleInArray sets the handle of the index element of the picture array array to newPictHandle.
If array is not a eVK_ArrayPicture or if index is out of range, the routine does nothing.
Because 4th Dimensions uses Macintosh Pictures internally, you must pass a pointer to a valid Macintosh Picture Handle.
A Macintosh Picture starts with 5 short values that gives the size and the rectangle of the picture respectively. Under Windows, these 5 short values need to be byte swapped into the Windows byte order.
Once this function is called, the handle belongs to the array variable, and should not be disposed.
Example
The examples given for the other PA_SetxxxInArray that initialized every element of an array to a special value cannot be used here. If we set 10 elements to the same handle, disposing of one of them will create a fool pointer in the others. Imagine that MyCreatePicture is a routine that creates a picture (OpenPicture-ClosePicture under MacOS) and returns a handle to it.
PA_Handle newPict; newPict = MyCreatePicture(); PA_SetPictureHandleInArray( arr, i, newPict );
See Also
PA_GetPictureHandleInArray, PA_GetPictureInArray, PA_SetPictureInArray.
Error Handling
None.