<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_SeekBin |
Declare Function sx_SeekBin Lib "Apollo9.dll"
(ByVal cpKeyValue As String
ByVal uiLength As Integer)
As Integer
BOOL FAR PASCAL sx_SeekBin
(BYTEP cpKeyValue,
USHORT uiLength);
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.
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.
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.
' 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