_BtGetDirect() Function

 

<< Click to Display Table of Contents >>

Navigation:  Low Level Functions >

 

_BtGetDirect() Function

 

Previous pageReturn to chapter overviewNext page

 

Purpose

 

 

Set the current fysical position of an open file

 

 

 

Prototype

 

 

FUNCTION _BtGetDirect ( hFile AS PTR, dwPosition AS DWORD, ptrData AS PTR,   nRecLen REF WORD, ptrKey AS PTR, nKeyNum AS BYTE, nLockBias  AS WORD )  AS LOGIC PASCAL

 

 

 

Argument(s)

 

 

<hFile>File handle that was returned by _BtOpen
<dwPosition>Physical position that you want to set
<ptrData>Pointer to the databuffer that you want to fill
<nRecLen>Length of the data structure. This value must be at least as long as the fixed-length portion of the record.
<ptrKey>Pointer to the Key buffer. Allocate BSIMAX_KEY_SIZE for this buffer
<nKey>Key Number, first key is numbered 0. Specify a value of 0xFF if you want no logical currency established.
<nLockBias>Lock bias to apply to the record. this can be one of the following:
0                                No Lock
BIAS_NOWAIT_LOCK                (200) Single Lock
BIAS_M_NOWAIT_LOCK        (400) Multilpe Lock

 

 

 

 

Return

 

 

LOGIC                Was the positioning successful

 

 

 

Description

 

 

The Get Direct/Record operation retrieves a record using its physical location in the file instead of using one of the defined index paths.

 

If the Get Direct/Record operation is unsuccessful and the MicroKernel cannot return the requested record, the MicroKernel may return one of the following status codes:

22Data Buffer Length
43Invalid Data Record Address
44Specified Key Path Invalid
82Application Lost Positioning
84Record/Page Locked
85File Locked

 

When you request a no-wait lock on a record that is currently not available (either the record is locked by another client or the whole file is locked by an exclusive transaction), the MicroKernel returns either Status Code 84 (Record/Page Locked) or Status Code 85 (File Locked).

 

 

 

See Also

 

 

_BtGetPos()