Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Paradox Engine 3.0 for C - /* the setup.c program must be compiled and run before this example */ http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
/* The SETUP.C program must be compiled and run before this example */
/* can be executed. */

#include <stdio.h>
#include <string.h>
#include "pxengine.h"

#define TABLENAME  "table"

int main(void)
{
  TABLEHANDLE   tblHandle;
  RECORDHANDLE  recHandle;
  char          blbBuffer[241];
  int           blbSize;
  PXCODE        pxErr;

  PXInit();

  /* Open a table that contains a BLOB field at field 4. */

  PXTblOpen(TABLENAME, &tblHandle, 0, 0);
  PXRecBufOpen(tblHandle, &recHandle);

  /* Place the first record of table into the record buffer. */

  PXRecLast(tblHandle);
  PXRecGet(tblHandle, recHandle);

  /* Get the first n bytes of the BLOB field where n is      */
  /* the size of the BLOB field in the table structure.      */

  if((pxErr = PXBlobQuickGet(recHandle, 4, sizeof(blbBuffer), blbBuffer,
    &blbSize)) != PXSUCCESS)
    printf("%s\n", PXErrMsg(pxErr));
  else
  {
    blbBuffer[blbSize] = '\0';
    printf("The BLOB field in the record contains the\
      following text:\n%s\n", blbBuffer);
  }
  PXRecBufClose(recHandle);
  PXTblClose(tblHandle);
  PXExit();
  return (pxErr);
}

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson