[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 BLOBEXPORT()
 Copy the contents of a BLOB, identified by its memo field number, to a file
------------------------------------------------------------------------------
 Syntax

     BLOBEXPORT(<nFieldPos>, <cTargetFile>, [<nMode>])
         --> lSuccess

 Arguments

     <nFieldPos> is the position of the field in the database file
     structure.

     <cTargetFile> is the name of the target file where the BLOB data
     will be written, including an optional drive, directory, and extension.
     See SETDEFAULT() and SETPATH() for file searching and creation rules.
     No default extension is assumed.

     If <cTargetFile> does not exist, it is created.  If it exists, this
     function attempts to open the file in exclusive mode and, if successful,
     the file is written to without warning or error.  If access is denied
     because another process is using the file, for example, NETERR() is set
     to true (.T.).  Concurrency control:and BLOBEXPORT()

     <nMode> is a constant defining the copy mode, as shown in the table
     below:

     Field Information Type Constants
     ------------------------------------------------------------------------
     Constant                 Description
     ------------------------------------------------------------------------
     BLOB_EXPORT_APPEND       Number of decimal places for the field
     BLOB_EXPORT_OVERWRITE    Length of the field
     ------------------------------------------------------------------------

 Returns

     BLOBEXPORT() returns true (.T.) if successful; otherwise, it returns
     false (.F.).

 Description

     By default, this function operates on the currently selected work area.
     It can be made to operate on an unselected work area by specifying it
     within an aliased expression.

 Examples

     .  This example exports the contents of a field that stores a
        picture to a graphic interchange format (.gif) file, so that the file
        can be programmatically displayed:

        FUNCTION SHOWPIX()
           LOCAL cPixFile := "Picture.gif"
           LOCAL nPos

           // Customer database with a picture of each
           // customer stored in a field called Pix
           USE Customer NEW VIA "DBFCDX"
           nPos := FIELDPOS("Pix")

           // Export the BLOB file's data
           // for the current Pix field
           IF !BLOBEXPORT(nPos, cPixFile,;
              BLOB_EXPORT_OVERWRITE)
                 ALERT("Export of picture " + cPixFile + ";
                    failed!")
           ELSE
              // Code for displaying picture would go here
           ENDIF

 Files   Library is CLIPPER.LIB.


See Also: BLOBDIRECTEXP() BLOBIMPORT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson