Metrologic Optimus S Programming Manual page 207

"c" programming guide
Table of Contents

Advertisement

create_DBF
Purpose
To create a DBF file and get its file handle for further processing.
Syntax
int create_DBF (char *filename, int member_len);
char *filename;
int member_len;
Example
if (fd = create_DBF ("data1", 64) > 0) puts ("data1 is created!\n");
Description
This routine creates a DBF file (filename) with its member length specified
(member_len), and gets the file handle of it.
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
6
9
12
See Also
close_DBF, create_index, open_DBF
create_index
Purpose
To create an IDX file of a DBF file.
Syntax
int create_IDX (int DBF_fd, int key_number, int key_offset, int key_len);
int DBF_fd;
int key_number;
int key_offset;
int key_len;
Example
create_index (DBF_fd, 1, 0, 10);
Chapter 3 Terminal Specific Function Library
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.
The argument member_len specifies the maximum member length of the
DBF file. Any member subsequently added to this DBF file with length
greater than member_len will be truncated to fit in.
User-defined indexes may be created after the DBF file is created.
Interpretation
filename is a NULL string.
Cannot create file. Because it is beyond the maximum
number of files allowed in the system.
Invalid value in argument: member_len
File specified by filename already exists.
/* offset in bytes where the key value in a member begins */
/* name of the file to be created */
/* member (record) length of the DBF file */
/* file handle of the associated DBF file */
/* key number of the IDX file to be created */
/* length of key value of the IDX file */
201

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents