sx_Found

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Found

VB Declaration

Declare Function sx_Found Lib "Apollo9.dll" () As Integer

C Declaration

BOOL FAR PASCAL sx_Found (VOID);

Description

Queries the result of the last index seek made on the current work area.

Return Value

True if the seek was successful and False if not. Note that sx_Seek immediately returns the result of a seek. sx_Found can be used after the fact to test the result of the last seek.

Note: The result of sx_Found may be compromised by a hidden relational seek (see sx_SetRelation) unless it is called immediately following the call to sx_Seek.

VB Example

' sx_Found can be used when sx_SoftSeek is TRUE

' to determine whether the record found is a match or

' the result of finding a record after the requested key

Sub ButtonSeek_Click ()

RecStr$ = InputBox$("Seek Key?", "Seek", "")

If RecStr$ = "" Then Exit Sub

RecStr$ = UCase$(RecStr$)

 

sx_SetSoftSeek True

If sx_Seek(RecStr$) Then

If sx_Found() Then

MsgBox "Exact or partial match!"

Else

MsgBox "Soft seek - on record after"

End If

Call sx_GetRecord(lRec)

BoxCust.Text = lRec.lCust

Else

MsgBox "Key Not Found"

sx_SetSoftSeek False

ButtonTop_Click

Exit Sub

End If

sx_SetSoftSeek False

End Sub

C Example

sx_SetSoftSeek(TRUE);

if (sx_Seek(cpSeekKey))

{

if (sx_Found())

AfxMessageBox((LPCSTR) "Exact or partial match.");

else

AfxMessageBox((LPCSTR) "Soft seek - on record after.");

sx_GetRecord(cpRecord);

}

else

AfxMessageBox((LPCSTR) "Key not found.");

sx_SetSoftSeek(FALSE);

See Also

sx_Seek, sx_SetExact, sx_SetSoftSeek