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

     BLOBGet(<nFieldPos>, [<nStart>], [<nCount>]) --> uBLOB

 Arguments

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

     <nStart> is the starting position in the memo field of the BLOB
     data.  If <nStart> is positive, the starting position is relative to the
     leftmost character in <nFieldPos>.  If <nStart> is negative, it is
     relative to the rightmost character in <nFieldPos>.  If <nStart> is
     omitted, it is assumed to be 1.

     <nCount> is the number of bytes of data to retrieve beginning at
     <nStart>.  If <nCount> is larger than the amount of data stored, excess
     data is ignored.  If omitted, BLOBGET() retrieves to the end of the
     data.

     Note:  <nStart> and <nCount> apply to string data only.  They are
     ignored for any other data types.

 Returns

     BLOBGET() returns the BLOB data retrieved from the memo field.  The data
     type of the return value depends on the actual data stored.  Use
     VALTYPE() to determine the data type.  If the indicated field is not a
     memo field, BLOBGET() returns NIL.

 Description

     BLOBGET() is very similar to FIELDGET().  However, because string type
     variables cannot be larger than 64 KB, FIELDGET() will raise a runtime
     error when attempting to retrieve memo fields of this magnitude or
     greater.

     BLOBGET() will also raise an error if you attempt to retrieve a field
     greater than this magnitude; however, you can retrieve any subset of the
     BLOB data by using an <nCount> less than 64 KB.

     Note:  BLOB data less than 64 KB can be retrieved from a memo field
     using standard means (for example, referring to the field by name in an
     expression or using the FIELDGET() function).

     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 imports information from a word processing
        document into a field, then uses BLOBGET() to extract the first 25
        characters of the field:

        FUNCTION GETFIRST25()
           LOCAL nPos
           LOCAL cStr

           USE customer NEW VIA "DBFCDX"

           // Field that contains word processor
           // documentation
           nPos := FieldPos("WP_DOC")

           // Import a file (can be larger than 64 KB), then
           // obtain the first 25 characters to show to the
           // user
           IF BLOBImport(nPos, "c:\application\temp.doc")
              cStr := BLOBGet(nPos, 1, 25)
           ELSE
              cStr := "Error: could not import file!"
           ENDIF

        CLOSE

        RETURN cStr


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