Deleterecord, Deletelastrecord, Appendrecord – Argox PA-20 Programming Guide User Manual

Page 64

Advertising
background image

PT-20 Programming Guide

62

Syntax: int GetRecordNum(_DBMS* F_Search);

Example call: int record_num;

record_num= GetRecordNum(&fsearch);

Includes:

#include “DBMS.h”

Description: GetRecordNum can pass back the amount of record storing in the file at

present.

Returns: Amount of record that stores in the file

DeleteRecord

Purpose: Use this function can delete the appointed record in the file.

Syntax: int DeleteRecord(_DBMS* F_Search,int recordnum);

Example call: DeleteRecord(&fsearch,2);//delete the third data of this file。

Includes:

#include “DBMS.h”

Description:

“DeleteRecord” can delete the appointed record, and change the size of

the file.

As success of deleting, file index will stay in the deleting record front. As

deleting defeat, file index will not move.

Returns: 0: Delete defeat. 1: Delete success.

DeleteLastRecord

Purpose: Use this function can delete the last record in the file.

Syntax: int DeleteLastRecord(_DBMS* F_Search);

Example call: DeleteLastRecord(&fsearch);

Includes:

#include “DBMS.h”

Description:

“DeleteLastRecord” can delete the last record in the file, and change the

size of the file.

As success of deleting, file index will stay in deleting record front. As

deleting defeat, file index will not move.

Returns: 0: Delete defeat. 1: Delete success.

AppendRecord

Purpose: Use this function can increase a new record on the file end.

Syntax: int AppendRecord(_DBMS* F_Search,char* record);

Example call:

char str_record[25]=”A1357924680,PA-20,3500”;

AppendRecord(&fsearch, str_record);

Includes:

#include “DBMS.h”

Description:

“AppendRecord” can increase a new record on the file end, the data of

record is introduced by char * record.

As increasing success, file index will be moved to the front of increasing

record.

Returns: -1: Write into defeat.

Advertising