Return and optionally change information about a field

        [<expNewSetting>]) --> uCurrentSetting


     <nInfoType> determines the type of information as specified by the
     constants below.  Note, however, that not all constants are supported
     for all RDDs, nor are all constants supported by all field types.  These
     constants are defined in the Dbstruct.ch header file, which must be
     included (#include) in your application.

     Field Information Type Constants
     Constant            Description
     DBS_BLOB_LEN        Returns the storage length of the data in a BLOB
                         (memo) file.
     DBS_BLOB_OFFSET     Returns the file offset of the data in a BLOB (memo)
     DBS_BLOB_POINTER    Returns a numeric pointer to the data in a blob
                         file. This pointer can be used with BLOBDirectGet(),
                         BLOBDirectImport(), etc.
     DBS_BLOB_TYPE       Returns the data type of a BLOB (memo) field. This
                         is more efficient than using Type() or ValType()
                         since the data itself does not have to be retrieved
                         from the BLOB file in order to determine the type.
     DBS_DEC             Number of decimal places for the field.
     DBS_LEN             Length of the field.
     DBS_NAME            Name of the field.
     DBS_TYPE            Data type of the field.

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

     <expNewSetting> is reserved for Clipper future use.  It can be
     omitted or specified as NIL.


     DBFIELDINFO() returns the current setting.


     DBFIELDINFO() retrieves information about the state of a field.  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.

     The field information that is available is defined by the RDD.

     To support RDDs for other database models (such as dictionary-based
     databases) that store more information about each field or column, the
     Clipper 5.3 RDD API has been enhanced.  The DBFIELDINFO() is designed
     to allow for additional <nInfoType> values that can be defined by third-
     party RDD developers.


     .  The following example uses DBFIELDINFO() to retrieve field

        #include Dbstruct.ch

        QOut(DBFIELDINFO(DBS_NAME, 1))         // Same as FIELDNAME(1)

           LOCAL aStruct := {}
           LOCAL nFcount, i

           nFcount := FCOUNT()
           FOR i := 1 TO nFcount
              AADD(aStruct, {FIELDNAME(i), ;
                                DBFIELDINFO(DBS_TYPE, i), ;
                                DBFIELDINFO(DBS_LEN, i),  ;
                                DBFIELDINFO(DBS_DEC, i)})
           RETURN aStruct

 Files   Library is CLIPPER.LIB, header file is Dbstruct.ch.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.