Dbfwd()
From Recital Documentation Wiki
Revision as of 12:55, 1 May 2009 by Yvonnemilne (Talk | contribs)
PURPOSE
position access pointer at the end of .NDX file
SYNOPSIS
#include "dbl.h" int dbfwd(ndx) <input parameter> char *ndx; /* .NDX file descriptor */ <output parameters> none
RETURN VALUE
The dbfwd() 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 positions the access pointer at the end of the specified .NDX file.
EXAMPLE
This example positions the access pointer at the end of the .NDX file whose file descriptor is in "int fd" and reads the last key from the file.
#include "dbl.h" int fd; /* .NDX file descriptor */ char key[100]; /* Buffer for previous key */ long recnum; /* Record number of previous key */ rc = dbfwd(fd); if (rc == SUCCESS){ rc = dbpkey(fd, key, &recnum); if (rc == SUCCESS) printf("Last key read \n"): else { printf("error number %d \n", rc); exit (1); } } else { printf("error number %d \n", rc); exit (1); }