Metrologic Optimus S Programming Manual page 210

"c" programming guide
Table of Contents

Advertisement

204
"C" Programming Guide For Optimus S/R
has_member
8
13
14
16
See Also
has_member
Purpose
To check if a data record (member) exists in a DBF file.
Syntax
int has_member (int DBF_fd, int key_number, char *key_value);
int DBF_fd;
int key_number;
/* key no. of the IDX file whose pointer points to the target member */
char *key_value;
/* pointer to a buffer holding key value to identify a specific member */
Example
if (has_member (DBF_fd, 1, "JOHN")) puts ("JOHN is on the name list!\n");
Description
This routine tries to locate a data record that matches the key value in an IDX
file (key_number), which is associated to a DBF file (DBF_fd).
If there is a complete match to the key_value, the index pointer will point
to the first of all matches.
In case there is more than one member containing the key value, user can
then check each member sequentially from the one currently is pointed to
by the index pointer until the desired member is found.
Return
If a member exists, it returns 1.
If a member does not exist, it returns 0.
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
2
4
7
8
13
14
See Also
get_member
File not opened.
Invalid value in argument: key_number
IDX file specified by key_number does not exist.
No members exist in the DBF file.
/* file handle of the target DBF file */
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.
Invalid value in argument: key_number
IDX file specified by key_number does not exist.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents