Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>dbappend()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DBAPPEND()
 Add a new record
------------------------------------------------------------------------------
 Syntax

     DBAPPEND() --> NIL

 Returns

     DBAPPEND() always returns NIL.

 Description

     DBAPPEND() adds a new record to the database (.dbf) file associated with
     the current work area.  If successfully added, each field in the record
     is set to the empty value for its data type and the new record becomes
     the current record.

     DBAPPEND() performs the same function as the standard APPEND BLANK
     command.  For more information, refer to the APPEND BLANK command.

 Notes

     .  Logical records: DBAPPEND() does not respect logical
        visibility.  That is, if the record is successfully added, it becomes
        the current record regardless of any index or filter condition.

     .  Network environment: For a shared database on a network,
        DBAPPEND() automatically places a record lock on the new record.  If
        the record cannot be locked, it is not added and a recoverable runtime
        error occurs.  The default CA-Clipper error handler handles this error
        by setting the system NETERR() status to true (.T.) and continuing
        execution.  For more information, refer to the Network Programming
        chapter in the Programming and Utilities guide.

 Examples

     .  The following example appends a blank record, checks for a
        network error and updates the data:

        DBUSEAREA( .T., "DBFNTX", "Sales", "Sales", .T. )
        .
        . <statements>
        .
        DBAPPEND()

        IF !NETERR()
           Sales->FirstName := cFirst
           Sales->LastName := cLast
        ELSE
           ? "Append operation failed"
           BREAK
        ENDIF

 Files:  Library is CLIPPER.LIB.

See Also: APPEND BLANK

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