PreviousBtrieve API Guide (9.1 revision 1) Next

Get Position (22)

Show this topic in Library frames

The Get Position operation (B_GET_POSITION) returns the physical 4-byte position of the current record. Get Position fails if there is no established physical currency when you issue the operation. Once you determine a record's position (address), you can use the Get Direct/Record operation (23) to retrieve that record directly by its physical location in the file. The MicroKernel does not perform any disk I/O to process a Get Position request.

Parameter
s
 
Op Code
Pos Block
Data Buf
Data Buf Len
Key Buffer
Key Number
Sent

 

 

Returned
 

   
Prerequisites
Procedure
  1. Set the Operation Code to 22.
  2. Pass the Position Block for the file.
  3. Set the Data Buffer Length to at least 4 bytes.
  4. Set the Key Number to 0.
Result

If the Get Position operation is successful, the MicroKernel returns the position of the record in the Data Buffer. The position is a 4-byte binary value (most significant word first) that indicates the record's offset (in bytes) into the file. The MicroKernel also sets the Data Buffer Length to 4 bytes.

If the Get Position operation is unsuccessful, the MicroKernel returns one of the following status codes:

3

The file is not open.

8

The current positioning is invalid.

Positioning

The Get Position operation has no effect on positioning.


Chapter contents
Publication contents

Prev topic: Get Next Extended (36)
Next topic: Get Previous (7)