Chapter 3 Terminal Specific Function Library
209
tell_DBF
Purpose
To get the current index pointer position of an IDX file.
Syntax
long tell_DBF (int DBF_fd, int key_number);
int DBF_fd; /* file handle of the associated DBF file */
int key_number; /* key number of the target IDX file */
Example
rank_number = tell_DBF (DBF_fd, 1);
Description
This routine gets the current index pointer position of an IDX file
(
key_number
), which is associated with a DBF file (
DBF_fd
).
The index pointer position is expressed in rank number in the IDX file. For
example, if the index pointer points to the first index, its position will be
1L.
Return
If successful, it returns the rank number for the current index pointer.
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.
13
Invalid value in argument:
key_number
14
IDX file specified by
key_number
does not exist.
See Also
lseek_DBF
update_member
Purpose
To update a data record (member) of a DBF file.
Syntax
int update_member (int DBF_fd, int key_number, char *member);
int DBF_fd; /* file handle of the target DBF file */
int key_number; /* key number of the associated IDX file */
char *member; /* pointer to a buffer holding the member to be updated */
Example
update_member (DBF_fd, 1, 10);
Description
This routine updates a data record (
member
) pointed to by the index pointer of
an IDX file (
key_number
), which is associated to a DBF file (
DBF_fd
).
Return
If successful, it returns 1.
On error, it returns 0.
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...