Dbrmvr()
From Recital Documentation Wiki
Revision as of 14:42, 1 May 2009 by Yvonnemilne (Talk | contribs)
PURPOSE
physically remove a record from a data file
SYNOPSIS
#include "dbl.h" int dbrmvr(dbf, recno) <input parameters> char *dbf; /* .DBF file descriptor */ long recno; /* Number of a record to be removed */ <output parameters> none
RETURN VALUE
The dbrmvr() function returns 0 for success, or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.
DESCRIPTION
This function physically removes a record from a .DBF file. All the records whose record numbers are greater than the record number of the deleted record are shifted up. For example, if the 18th record is requested to be deleted, and 20 records currently exist in the database, the 19th and 20th will become 18th and 19th respectively.
EXAMPLE
The following example physically removes the 5002nd record from the data file whose file descriptor is in "char *dbf"
#include "dbl.h" char *dbf; /* .DBF file descriptor */ int rc; /* Return code */ rc = dbrmvr(dbf, (long) 5002); if (rc == SUCCESS) printf("record removed \n"); else { printf("error number %d \n", rc); exit (1); }