Metrologic Optimus S Programming Manual page 212

"c" programming guide
Table of Contents

Advertisement

206
"C" Programming Guide For Optimus S/R
open_DBF
total_member = member_in_DBF (DBF_fd);
Example
Description
This routine returns the number of members in a DBF file whose file handle is
specified by DBF_fd.
Return
If successful, it returns the number of members.
On error, it returns -1L.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
2
4
7
8
See Also
Purpose
To open an existing DBF file and get its file handle for further processing.
Syntax
int open_DBF (char *filename);
char *filename;
Example
if (fd = open_DBF ("data1") > 0) puts ("data1 is opened!\n");
Description
This routine opens a DBF file (filename) and gets the file handle of it.
A file handle is a positive integer (greater than zero) used to identify the
file for subsequent file manipulation on the file.
If filename exceeds eight characters, it will be truncated to eight
characters.
Simultaneously, it opens all the IDX (key) files associated with the DBF
file being opened. After the DBF is opened, the index pointers of all the
associated index files point to the beginning of the respective index.
Return
If successful, it returns the file handle.
On error, it returns -1.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
1
2
4
5
Interpretation
File specified by DBF_fd does not exist.
File specified by DBF_fd is not a DBF file.
Invalid file handle.
File not opened.
Interpretation
filename is a NULL string.
File specified by filename does not exist.
File specified by filename is not a DBF file.
File specified by filename is already opened.
/* name of the file to be opened */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents