_DBAppend( ) API Library Routine

See Also   Example

Attempts to append a new record to the table open in the specified workarea.

Syntax

int _DBAppend(int workarea, int carryflag)
int workarea;               /* Work area number. */
int carryflag;               /* SET CARRY setting. */

Remarks

The current work area is represented by  – 1. _DBAppend( ) returns 0 if the routine is successful. If the routine fails, _DBAppend( ) returns a negative integer whose absolute value is a Visual FoxPro error number.

Values for carryflag

Value Effect
1 Carries information from the previous record into the new record.
0 Makes the new record blank.
– 1 Uses the setting of SET CARRY to determine whether information from the previous record is carried to the new record.

_DBAppend( ) automatically performs any necessary locking. If it's unable to lock the file header, _DBAppend( ) fails and returns a negative integer whose absolute value is a Visual FoxPro error number.

For more information on how to create an API library and integrate it with Visual FoxPro, see Chapter 28, Accessing the Visual FoxPro API, in the Programmer's Guide.