PA_GetBlobHandleField


version 2003


PA_GetBlobHandleField (tNum; field) → PA_Handle

Parameter Type Description
tNum short Table number of the field to access
field short Field number of the field to access
Function result PA_Handle Handle to the BLOB

Description

The routine PA_GetBlobHandleField returns a handle to the BLOB data of the field number fNum of the current record of table number tNum .

If the field is not a BLOB field, the routine returns 0 and an error code in PA_GetLastError .

WARNING

The handle belongs to 4th Dimension. Never dispose of it .

To get a copy of the data, use PA_GetBlobField . It is is really only useful in getting the Handle for saving memory, especially if the plug-in just want to view the BLOB content as "read-only".

Example

Searching in a BLOB : We do not need a copy of the BLOB for that. The handle is ok.

   long MySearchInBlobField( short tNum, short fNum, char *toFind, long toFindLength )
   {
      long   pos = -1L;
      PA_Handle   h = 0L;
      char   *pt;
 
      h = PA_GetBlobHandleField( tNum, fNum );
      if ( h )
      {
         pt = PA_LockHandle( h );
         pos = SuperSearchRoutine( pt, PA_GetHandleSize( h ), toFind, toFindLength );
         PA_UnlockHandle( h );
      }
 
      return pos;
   // No cleanup of h here !
   }

See Also

PA_GetBlobField , PA_SetBlobHandleField .

Error Handling

Use PA_GetLastError to see if an error occurred ( eER_InvalidFileNumber , eER_InvalidFieldNumber ).