Searchfield_gf – Argox PA-20 Programming Guide User Manual
Page 61

PT-20 Programming Guide
59
recordno, char* R_Buffer, int flag);
Example call:
char str[8]=”abcdefg”,str_buffer[60];
SearchField_GR(&fsearch, str,0,0, str_buffer,FORWARD);
Includes:
#include “DBMS.h”
Description: This function can search and contrast the data of appointed field. After
success, reading the record which includes this field.
Several describe the argument as follows:
argument
description
_DBMS* F_Search
The file’s searching structure that has been
initialized.
char* field
String data wanted to match.
int search_fieldno
Field wanted to search.
int recordno
Begin to search from which data.
char* R_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 “R _ Buffer = NULL”, pass back – 1: Search defeat; Pass other
value back: That is the size of space for buffer.
When “R _ Buffer ≠ NULL”, pass back – 1: Search defeat; Pass other
value back: That is the record position which confirm to contrast data.
Purpose: Search the designated field. After success, acquiring the appointed field
in including the field’s record.
Syntax: int SearchField_GF(_DBMS* F_Search, char* field, int search_fieldno, int
recordno, int get_field_no, char* F_Buffer, int flag);
Example call:
char str[8]=”abcdefg”,str_buffer[60];
SearchField_GF(&fsearch, str,0,0,1,str_buffer,FORWARD);
Includes:
#incl
ude “DBMS.h”