Difference between revisions of "BLOB WRITE()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) m (1 revision) |
(No difference)
|
Revision as of 06:34, 11 April 2013
PURPOSE
Write a blob
SYNONYM
api_blob_write()
SYNOPSIS
#include "lianjaapi.h" int BLOB_WRITE(fldname, blob, size) <input parameters> char *fldname; /* Address of a buffer containing a blob field name */ unsigned char blob; /* Address of a buffer containing blob data */ int size; /* Blob size */ <output parameters> none
DESCRIPTION
The BLOB_WRITE() function writes a blob field from the specified buffer into a memo file, and updates the current record buffer.
EXAMPLE
The following example updates the blob field specified in the first parameter passed.
#include "lianjaapi.h" lianjaapi_blob_write() { int result; if (_parinfo(1) == API_CTYPE && _parinfo(2 ) == API_CTYPE) { if (!DBF_ISEXCLUSIVE()) DBF_LOCKR(DBF_RECNO()); result = BLOB_WRITE( _parc(1), (unsigned char) _parc(2), _parcsiz(2) ); if (result) result = DBF_UPDATE(); if (!DBF_ISEXCLUSIVE()) DBF_UNLOCKR(DBF_RECNO()); } else { result = -1; } _retl( (result) ? 1 : 0 ); }