Seekrecord, Getrecordnum – Argox PA-20 Programming Guide User Manual
Page 63

PT-20 Programming Guide
61
argument
description
_DBMS* F_Search
The file’s searching structure that has been
initialized.
char* multi_field
String data wanted to match.
The string form is “field string 0, field
number 0; field string 1, field number 1;...
”.
Each field string and field number use
separate symbol ”,”, behind the field number
use separate symbol ”;”, last field number
don’t use any separate symbol.
int recordno
Begin to search from which data.
int get_field_no
After contrasting success, acquiring the data
of appointed field in this record.
char* F_Buffer
After contrast success, it will write record
which included this field into buffer.
int flag
FORWARD => Search from forward to
backward
BACKWARD => Search from backward to
forward
As success of searching, the file index will
stay in successful record front. When search
defeat, the file index will not be moved.
Returns:
When “F _ Buffer = NULL”, pass back – 1: Search defeat; Pass other
value back: That is the size of space for buffer.
When “F _ Buffer ≠ NULL”, pass back – 1: Search defeat; Pass other
value back: That is the record position which confirm to contrast data.
Purpose: Move the searching index to the appointed record.
Syntax: long SeekRecord(_DBMS* F_Search,int recordno);
Example call: SeekRecord(&fsearch,10);//move file index to eleventh record。
Includes:
#include “DBMS.h”
Description: Use this function can move the search index to appointed record. The
number of first record is 0. The number of second record is 1.
Returns: -1: The index move is defeated.
Other value: the present address of searching index
Purpose: Use this function can read the total amount of records storing in the file at
present. .