206
"C" Programming Guide For Optimus S/R
Example
total_member = member_in_DBF (DBF_fd);
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
Interpretation
2
File specified by
DBF_fd
does not exist.
4
File specified by
DBF_fd
is not a DBF file.
7
Invalid file handle.
8
File not opened.
See Also
open_DBF
Purpose
To open an existing DBF file and get its file handle for further processing.
Syntax
int open_DBF (char *filename);
char *filename; /* name of the file to be opened */
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
Interpretation
1
filename
is a NULL string.
2
File specified by
filename
does not exist.
4
File specified by
filename
is not a DBF file.
5
File specified by
filename
is already opened.
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...