sx_SeekBin

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_SeekBin

VB Declaration

Declare Function sx_SeekBin Lib "Apollo9.dll"

(ByVal cpKeyValue As String

ByVal uiLength As Integer)

As Integer

C Declaration

BOOL FAR PASCAL sx_SeekBin

(BYTEP cpKeyValue,

USHORT uiLength);

Description

Searches the current order for a supplied key. The key may contain binary zeroes.

 

Some xBase programmers become very innovative in inventing data storage algorithms that bypass the standard xBase character fields. These data storage functions usually involve some type of binary representation to conserve space (e.g., representing time in two bytes - the first byte hours and the second minutes). If indexes are constructed on these fields, the search value cannot be passed as a string because the value may contain a binary zero - which normally signifies the end of a string.

Parameters

cpKeyValue: The binary value to search for. The search key value may be a partial key (if sx_SetExact is not True).

uiLength: The length of the search key.

Return Value

True if the key was found and False if not. If the return is False, sx_Found will be False and sx_Eof will be True.

 

For various conditions that may affect the return value, see sx_Seek.

VB Example

' seek binary key on time >= 1am

KeyString$ = Chr$(0) + Chr$(1) + Chr$(0) + Chr$(0)

sx_SetSoftSeek True

If Not sx_SeekBin(KeyString$, 4) Then

MsgBox "Key not found"

sx_SetSoftSeek False

Exit Sub

End If

See Also

sx_Descend, sx_Found, sx_Seek, sx_SetExact, sx_SetSoftSeek