Searchfield, Searchfield_gr – Argox PA-20 Programming Guide User Manual

Page 60

Advertising
background image

PT-20 Programming Guide

58

Syntax: int Close_Search(_DBMS* F_Search);

Example call: Close_Search(&F_Search);

Includes:

#include “DBMS.h”

Description: When want to finish the file searching state, you can use this function.

Returns: 0: Close defeat.

1: Close success.

SearchField

Purpose: SearchField can search the appointed field that begin from the appointed

record and compare with importing string. If agreeing, pass back to the

first record.

Syntax: int SearchField(_DBMS* F_Search, char* field, int search_fieldno, int

recordno, int flag);

Example call:

char str[8]=”abcdefg”;

int Record_Num;

Record_Num =SearchField(&fsearch, str,0,0,FORWARD);

Includes:

#include “DBMS.h”

Description: 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.

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: -1: Search defeat.

Other value: Match the record position of data

SearchField_GR

Purpose: SearchField_GR can search the appointed field that begin from the

appointed record and compare with importing string. If agreeing, it will

copy the record which included the field to buffer.

Syntax: int SearchField_GR(_DBMS* F_Search, char* field, int search_fieldno, int

Advertising