PreviousBtrieve API Guide (v9 SP2 (9.5) revision 1) Next

Sequence of Events in Performing a Btrieve API Operation

Chapter contents

To perform a Btrieve API operation, your application must complete the following tasks:

  1. Satisfy any prerequisites the operation requires. For example, before your application can perform any file I/O operations, it must make the file available by performing an Open operation (0) on that file.
  2. Initialize the parameters that the Btrieve API operation requires. The parameters are program variables or data structures that correspond in type and size to the particular values that the transactional interface expects for an operation.
  3. For future compatibility, initialize all parameters, whether or not they are used. For parameters of type INTEGER, set the value to binary 0. For character arrays, pass a pointer to a buffer. Initialize the first byte of the buffer to binary 0.

  4. Call the appropriate Btrieve API function. (Refer to Btrieve API Functions .)
  5. Evaluate the results of the function call. Every Btrieve API operation returns a status code. Your application must check the status code and take the appropriate action. The operation also returns data or other information to the individual parameters based on the purpose of the operation.

Chapter contents
Book contents

Prev topic: Summary of Btrieve API Operations
Next topic: Btrieve API Operations