version 2003
PA_SetPictureHandleField (tNum; fNum; newHPicture)
Parameter | Type | Description | |
tNum | short | Table number of the field to access | |
fNum | short | Field number of the field to access | |
newHPicture | PA_Handle | New handle for the picture field |
Description
The routine PA_SetPictureHandleField sets the handle of the picture field number fNum of the current record of table number tNum to newHPicture.
If the field is not a picture field, the routine does nothing and sets an error in PA_GetLastError().
This is useful for memory optimisation: PA_SetPicturField duplicates the BLOB, since PA_SetPictureHandleField changes only the value of the handle to the BLOB field.
IMPORTANT NOTE
After the call, the handle belongs to 4th Dimension. Never dispose of it.
Example
Create a new picture and assign it to a field (MacOS or Windows+Altura)
PicHandle picture; PictureInfo info = {0, 0, 0}; picture = OpenPicture(aRect); /* . . . draw the picture . . . */ ClosePicture(); PA_SetPictureHandleField(tNum, fNum, (PA_Handle) picture, info); // Now, picture BELONGS TO 4D
See Also
Error Handling
Use PA_GetLastError to see if an error occurred (eER_InvalidFileNumber, eER_InvalidFieldNumber).